开发者

getElementsByName in opera, ie etc

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜