XML DOM 教程

XML DOM hasAttributes() 方法

Element 对象参考手册 Element 对象

定义和用法

hasAttributes() 方法在当前元素节点拥有属性时返回 TRUE,否则返回 FALSE。

语法

hasAttributes()

实例

实例


xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName('book')[0];
document.write(x.hasAttributes());

输出:


true

Element 对象参考手册 Element 对象其他扩展

用微信扫一扫

收藏