开发者

getElementsByName in opera, ie etc

开发者 https://www.devze.com 2023-01-27 23:26 出处:网络
this is my code to fix compability getElementById in ie,ff,opera etc function getId(item) { if( window.mmIsOpera ) return(document.getElementById(item));

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

0

精彩评论

暂无评论...
验证码 换一张
取 消