this is my code to fix compability getElementById in ie,ff,opera etc
function getId(item) {
if( window.mmIsOpera ) return(document.getElementById(item));
if (document.all) return(document.all[item]);
if (document.getElementById) return(document.getElementById(item));
return(false开发者_StackOverflow社区);
}
my question is, how about getElementsByName in ie,ff, opera..
getElementsByTagName is supported by all major browsers:
http://www.quirksmode.org/dom/w3c_core.html
i got the solution last night...
and to get value from text field, just add an atribut "name" in form..
like David Dorward said : document.nameOfForm.nameOfTextfield.value
精彩评论