Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
doc: Merge/update the old Element.hasAttribute docs into source [prot…
…otypejs#90 state:fixed_in_branch]
  • Loading branch information
dandean authored and samleb committed Jan 9, 2010
1 parent 1cadce1 commit c5ac98d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/dom/dom.js
Expand Up @@ -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
*
* <a id="link" href="http://prototypejs.org">Prototype</a>
*
* $('link').hasAttribute('href');
* // -> true
**/
hasAttribute: function(element, attribute) {
attribute = Element._attributeTranslations.has[attribute] || attribute;
var node = $(element).getAttributeNode(attribute);
Expand Down

0 comments on commit c5ac98d

Please sign in to comment.