Can you try replacing your code line with the below and see if it works
document.body.style.backgroundColor = document.getElementById('HiddenField1').value;
if that doesnt work, then try using jquery like the sample below
$('body').css('background', '#ccc');