参考 hasAttribute()

hasAttribute()

Returns true if the element has a given attribute and false if not.

The parameter, name, is a string with the name of the attribute being checked.

Note: Use myXML.getString() or myXML.getNum() to return an attribute's value.

示例

语法

hasAttribute(name)

参数

name
String:

name of the attribute to be checked.

Returns

Boolean: whether the element has the attribute.
Notice any errors or typos? Please let us know. Please feel free to edit src/io/p5.XML.js and open a pull request!

相关参考