81
rated 0 times
[
84]
[
3]
/ answers: 1 / hits: 134602
/ 15 Years ago, wed, march 17, 2010, 12:00:00
Is it possible to set the height/width of an element in percent using JavaScript or jQuery?
More From » jquery
Is it possible to set the height/width of an element in percent using JavaScript or jQuery?
document.getElementById('header').style.width = '50%';
If you are using Firebug or the Chrome/Safari Developer tools, execute the above in the console, and you'll see the Stack Overflow header shrink by 50%.