function func(){
with (document.forms[0]){
inputid.value = "text"; //Works!
spanid.innerHTML = "text"; //Err, spanid is not defined.
}
}
This is not working in Firefox but it is in IE7. I debug in Firebug, spanid is not defined, but I can use document.getElementById("spanid") to select this element. I just don’t know why? The input element works fine!
Shouldn’t it be
document.forms[0](notice the s on form)**EDIT**
Since the answers aren’t rolling in on this one, here’s my suggestion. Simply it. Use the methods you’re familiar with and don’t waste time trying to get this to work.