JavaScript getAttribute( )方法

该方法返回目标对象指定属性名称的某个属性值。语法如下:object.getAttribute(attribute)其中attribute 为对象指定要搜索的属性,下面的代码演示其使用方法:[code]

Sample Page!

This is the first Sample!

[/code]上述代码通过objSample.length 控制循环,遍历整个文档的

标记。

运行结果显示为“First Sample”。

以上从节点定位到获得其指定的属性值,都只能检索信息。