src code

instance method Element#hasAttribute

Element#hasAttribute(attribute) → Boolean

Simulates the standard compliant DOM method hasAttribute for browsers missing it (Internet Explorer 6 and 7).

Example
<a id="link" href="http://prototypejs.org">Prototype</a>

Then:

$('link').hasAttribute('href');
// -> true

This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.