isElementProperty() (Simulated functionality)

A function that tells you whether a property name is inherited from Element objects.

Property/method value type:Boolean primitive

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.

Example code:

   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