182
rated 0 times
[
186]
[
4]
/ answers: 1 / hits: 15950
/ 13 Years ago, fri, april 22, 2011, 12:00:00
This should be real simple... But it ain't... >.<
var x = document.getElementById('x');
function snooze()
{
x.style.height = '10px';
}
Upon execution, the error I get is:
TypeError: Result of expression 'x' [null] is not an object.
Edit: Heads up, it works when I put the var declaration inside the function. I don't understand... :-(
function snooze()
{
var x = document.getElementById('x');
x.style.height = '10px';
}
More From » javascript