diff --git a/src/dom/dom.js b/src/dom/dom.js index 81c92f638..a01aab1ef 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -2424,6 +2424,20 @@ Element._insertionTranslations = { })(); Element.Methods.Simulated = { + /** + * Element.hasAttribute(@element, attribute) -> Boolean + * + * Simulates the standard compliant DOM method + * [`hasAttribute`](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElHasAttr) + * for browsers missing it (Internet Explorer 6 and 7). + * + * ##### Example + * + * Prototype + * + * $('link').hasAttribute('href'); + * // -> true + **/ hasAttribute: function(element, attribute) { attribute = Element._attributeTranslations.has[attribute] || attribute; var node = $(element).getAttributeNode(attribute);