N
Nik
Hello! Thanks for reading my question first!
I have many divs with an numeral id ,for example <div
id="999">...</div>, <div id="1000">...</div>
and I wish to do something like this,
for( var i = startvalue; i<=endvalue; i++){
document.getElementById(i).style.background="yellow;";
}
but after the first changing background, it stops and tell me that the
document.getElementById(i) has no properties. And I am sure that those
div's exist.
What's going wrong?
Thanks So Much!
I have many divs with an numeral id ,for example <div
id="999">...</div>, <div id="1000">...</div>
and I wish to do something like this,
for( var i = startvalue; i<=endvalue; i++){
document.getElementById(i).style.background="yellow;";
}
but after the first changing background, it stops and tell me that the
document.getElementById(i) has no properties. And I am sure that those
div's exist.
What's going wrong?
Thanks So Much!