This function switches according to the value of a text string that is passed in. If the string is in the set of strings that enumerate properties that belong to an Element object then the value true will be returned. This indicates that the property is defined in a super-class.
You can build property enumeration loops that test for this value to build debugging displays of object properties that are less cluttered than simply displaying all the object properties.
The result of this method is true if the property has been inherited from the Element object otherwise the false value is returned.
function isElementProperty(aProperty) { switch(aProperty) { case "all" : case "attributes" : case "childNodes" : case "children" : case "className" : case "currentStyle" : case "dir" : case "document" : case "filters" : case "firstChild" : case "id" : case "innerHTML" : case "innerText" : case "isTextEdit" : case "lang" : case "language" : case "lastChild" : case "nextSibling" : case "nodeName" : case "nodeType" : case "nodeValue" : case "offsetHeight" : case "offsetLeft" : case "offsetParent" : case "offsetTop" : case "offsetWidth" : case "outerHTML" : case "outerText" : case "ownerDocument" : case "parentNode" : case "parentElement" : case "parentTextEdit" : case "previousSibling" : case "sourceIndex" : case "style" : case "tagName" : case "title" : return true; } return false; }
See also: | Element object |
Prev | Home | Next |
isDigit() | Up | isFinite() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |