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!