Let's say I have a few divs with IDs like "div1", "div2", "div3" and so on.
What I am doing now is:
document.getElementById('#div1').value='something';
document.getElementById('#div2').value='something';
document.getElementById('#div3').value='something';
but this gets annoying if I have like 30 divs. I'm trying to use "for" but it's not working:
for(var i=1; i<31; i++) {
document.getElementById('#div'+i).value='something';
}
I'm getting the same thing when I use the .val() function (jQuery).
What am I doing wrong in this case, guys? :)