632 Part IV: Appendixes
MethodShorthandDescriptiongetElementById(id [,startNode,deepSearch])NoneReturns a single DOM element that matches the idpassed as a string; otherwise a null value is
returned. AstartNodecan be passed to indicatewhere the search begins from; otherwise the document is assumed. The Boolean parameter deepSearchcan be set totrueto perform abrute force search ofidattribute values thatmay be useful when addressing XML trees as commonly found in Ajax response packets.getElementsById(id [,startNode,deepSearch]) $id()Returns a single DOM element or list of DOM elements that match theid(s) passed as strings.AstartNodecan be passed to indicate wherethe search begins from; otherwise the document is assumed. The Boolean parameterdeepSearchcan be set to true to perform a brute force search ofidattribute values that may be useful whenaddressing XML trees as commonly found in Ajax response packets.getElementsByClassName(className [,startNode]) $class()Returns a list of all the DOM elements with the specified class name. More qualified searches, such as for the stem of a class name, should use thegetElementsBySelector()methodinstead.getElementsBySelector(selector [,startNode]) $selector()Finds all the DOM elements matching the selectorstring passed starting from thestartNodeor the document root if not specified.Theselectorstring should be a string that is awell-formed CSS2 selector rule.insertAfter(parentNode,nodeToInsert,insertPoint)NoneInserts the DOM node specified bynodeToInsertafter the node specified byinsertPoint. The
parentNodethis operates on must be passed forreference.T
ABLEC-13Useful DOM Methods