js summary of common nodes

<p> nodeName String node definition, according to the definition of the type of the node; </ p>
<p> nodeValue String value of the node, according to the definition of the type of the node; </ p>
<p> nodeType Number one node type constant value; </ p>
<p> ownerDocument Document points to the document this node belongs; </ p>
<p> firstChild Node points to the first node in the childNodes; </ p>
<p> lastChild Node point in the last node in the childNodes; </ p>
<p> childNodes NodeList list of all child nodes; </ p>
<p> previousSibling Node points to the previous sibling node; If this node is the first node, then the value is NULL; </ p>
<p> nextSibling Node to the next sibling node; If this node is the first node, then the value is NULL; </ p>
<p> hasChildNodes () Boolean When childNodes contains one or more nodes, return true; </ p>
<p> Attributes NamedNodeMap contains an element representing the characteristics of the attr object, only for Element node; </ p>
<p> appendChild to the end node to the childNodes; </ p>
<p> removeChild to delete node; </ p>
<p> replaceChild (newnode, oldnode) replace the node, will oldnode replaced newnode; </ p>
<p> insertBefore (newnode, refnode) in the childNodes of refnode insert newnode; </ p>
<p> </ p>
<p> </ p>
<p> </ p>
<p> handling attributes: </ p>
<p> getNamedItem (name): return nodeName attribute value equal to the name of the node; </ p>
<p> removeNamedItem (name): delete the nodeName attribute value equal to the name of the node; </ p>
<p> setNamedItem (node): the node added to the list, its nodeName attribute index; </ p>
<p> item (pos): same as with the NodeList, return the node at position pos; </ p>
<p> example: </ p>
<p> <p> hello world </ p> </ p>
<p> </ p>
<p> var sid = op.attributes.getNameItem ("id"). nodeValue; or var sid = op.attributes.getNameItem (1). nodeValue; </ p>
<p> </ p>
<p> var sid = op.getAttribute ("id ");</ p>
<p> op.setAttribute ("id", "newid ");</ p>
<p> </ p>
<p> Add node: </ p>
<p> var op = document.create_rElement ("p ");</ p>
<p> var otext = document.create_rTextNode ("hello .");</ p>
<p> op.appendChild (otext); </ p>
<p> document.body.appendChild </ p>
标签: boolean, lt, attribute, string value, element, sibling, child nodes, childnodes, document points, node points
分类: Web
时间: 2010-12-30


  1. I java written summary of common topics

    Note: This is my java written summary of common topics, not pen Question Daquan, not necessarily other compani ...
  2. Summary of common SQL techniques

    Summary of common SQL techniques 1 specifies an integer, the column width of 3, less than make up 0 alter tabl ...
  3. Ext summary of common problems

    scripts/ext/resources/css/ext-all.css//EXT Common CSS, contains all the style ( Must ) scripts/ext/resources/c ...
  4. js summary of some work

    1. Multi-line replacement s = s.replace (/ \ \ s / gm ,""); 2. Js math function in var d = Math.roun ...
  5. js manual, JS in some common helpful tips

    Js in each of the tips are, but very practical! 1.document.write (""); output statements 2.JS the co ...
  6. web entry summary of common errors when the servlet

    The most common path error, as long as you understand the following points deep , You will be able to successf ...
  7. summary of common service environment xp

    In the xp system , Nearly 90 service , More than 30 services enabled by default , In fact we only need a few i ...
  8. Sql server summary of common performance issues

    1 the query is optimized, should avoid full table scans, we should first consider where and order by columns o ...
  9. js examples of common events

    <html> <head> <script type="text/javascript"> / / Which mouse button is clicked fu ...
  10. js increase in child nodes

    <html> <head> <title> </ title> <script language="javascript"> functio ...
  11. java written summary of common questions

    Original link:
  12. js a few common functions (replace,)

    1: replace replace ==== Replace all characters (like java's new String (). ReplaceAll) var str=" People's ...
  13. DIV + CSS summary of common errors

    1. Check the HTML element is misspelled, is forget the closing tag Even the veteran is also often mistaken div ...
  14. JBPM4 summary of common errors

    1. Under the deployment of an error in tomcat6.0 Based JBPM4 of web Error jsp page publishing project Phenomen ...
  15. IE, firefox (Firefox) browser, close the window without prompt implementation code js Summary

    <script type="text/javascript"> function closeme () (var browserName = navigator.appName; if ( ...
  16. Summary of common eclipse plugin

    1, easyexplore To annex, version 1.0.1 2, JsEclipse ...
  17. js util --- html common usage

    1. Hide error <script type="text/javascript"> window.onerror=function(){return true;} </scr ...
  18. FusionCharts summary of common property

    FusionCharts the XML tag attributes have about four data types * Boolean - Boolean type can only be 1 or 0. Fo ...
  19. summary of common cross-platform php predefined constants