javascript - document.form[0] does not work on Firefox -
function func(){ (document.forms[0]){ inputid.value = "text"; //works! spanid.innerhtml = "text"; //err, spanid not defined. } }
this not working in firefox in ie7. debug in firebug, spanid not defined
, can use document.getelementbyid("spanid")
select element. don't know why? input element works fine!
shouldn't document.forms[0]
(notice s on form)
**edit**
since answers aren't rolling in on one, here's suggestion. it. use methods you're familiar , don't waste time trying work.
function yourfunction() { var objspan = document.getelementbyid([insert element id]); var objinput = document.getelementbyid([insert element id]); objspan.innerhtml = "text"; ... }
Comments
Post a Comment