您的位置首页生活百科

getelementbyid介绍

getelementbyid介绍

的有关信息介绍如下:

getelementbyid介绍

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