I am trying to run this statement: $(\'body\').height(100);
but when I check the height again, I find it unchanged!
Is there any way to change the heigh
document body is a magical element and does not behave the way other HTML elements do. Your code:
$('body').height(100);
Is correct and it is same as:
$('body').css({height: 100});
$('body').css({height: '100px'});
$('body').attr({style: 'height: 100px'});
All result in this:
However, setting the height will not hide the area outside the 100px height invisible. You should wrap the body content inside a div and set its height instead:
jQuery solution would be:
$("body").wrapInner($('').css({
height: 100,
overflow: "hidden"
}));