Checks if the element has an attribute with the given name.

This function returns the same result as the following expression:

getAttr(attrName) != null
However, it will work faster, since no GOMAttribute object will be allocated.

Parameters:

element

The element whose attribute is checked. If not specified, the generator context element is assumed, i.e. the same as the call: hasAttr(contextElement, attrName)
attrName
The attribute name

Returns:

true if the element contains an attribute with the specified name;
false otherwise (or in the case element == null)

See Also:

getAttr(), setAttr(), hasAttrValue(), GOMAttribute
Tip:

You may call this function in a more method-like style, e.g.:

element.hasAttr(attrName)