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.
--------------------------------------------------------------------------------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.
--------<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找找
oElement = document . getElementById ( sID )
参数:
sID : 必选项。字符串(String)。 返回值:
oElement : 对象(Element)。 说明:
根据指定的 id 属性值得到对象。返回 id 属性值等于 sID 的第一个对象的引用。假如对应的为一组对象,则返回该组对象中的第一个。
如果无符合条件的对象,则返回 null 。
你们引用的这些文字都是从哪儿找的啊
除了MSDN之外
还有像activeElement这些东西的用法,我从哪儿才能找到相关资料呢?
授人以鱼不若授人以渔,对吧,谢谢。:)
DHTML.CHM 到google搜索一下吧。
HTML、CSS、HTC等的官方文档(msdn中的inet文件,如果你有的话就不要下载了,有121M)