The Element.hasAttribute() method returns a Boolean value indicating whether the specified element has the specified attribute or not.
Element.hasAttribute()
external bool hasAttribute(String qualifiedName);