From c5ac98d3a11d62935e4576f3f11460646e2911f1 Mon Sep 17 00:00:00 2001 From: dandean Date: Sat, 9 Jan 2010 10:10:11 -0800 Subject: [PATCH] doc: Merge/update the old Element.hasAttribute docs into source [#90 state:fixed_in_branch] --- src/dom/dom.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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);