getElementById Method
--------------------------------------------------------------------------------Returns a reference to the first object with the specified value of the ID attribute.SyntaxoElement = document.getElementById(sIDValue)ParameterssIDValue Required. String that specifies the value of an ID attribute. Return ValueReturns the first object with the same ID attribute as the specified value.ResIf the ID value belongs to a collection, the getElementById method returns the first object in the collection.

解决方案 »

  1.   

    Example:
    --------<SCRIPT>
    function fnGetId(){
       // Returns the first DIV element in the collection.
       var oVDiv=document.getElementById("oDiv");
    }
    </SCRIPT>
    <DIV ID="oDiv">Div #1</DIV>
    <DIV ID="oDiv">Div #2</DIV>
    <DIV ID="oDiv">Div #3</DIV>
    <INPUT TYPE="button" VALUE="Get Names" onclick="fnGetId()">
    去MSDN找找
      

  2.   

    getElementById 通过id获取对象:
      

  3.   

    语法:
    oElement = document . getElementById ( sID ) 
    参数:
    sID  : 必选项。字符串(String)。 返回值:
    oElement  : 对象(Element)。 说明:
    根据指定的 id 属性值得到对象。返回 id 属性值等于 sID 的第一个对象的引用。假如对应的为一组对象,则返回该组对象中的第一个。 
    如果无符合条件的对象,则返回 null 。 
      

  4.   

    楼上几位大哥
    你们引用的这些文字都是从哪儿找的啊
    除了MSDN之外
    还有像activeElement这些东西的用法,我从哪儿才能找到相关资料呢?
    授人以鱼不若授人以渔,对吧,谢谢。:)
      

  5.   

    这是dhml,可以下载其帮助文档的
    DHTML.CHM 到google搜索一下吧。
      

  6.   

    http://www.oceanstudio.net:8090/ocean/helpdoc/inet.rar
    HTML、CSS、HTC等的官方文档(msdn中的inet文件,如果你有的话就不要下载了,有121M)
      

  7.   

    除了msdn之外还有没有其他的这类电子版资料下载啊?