⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dom_node.asp@output=print

📁 W3Schools tutorial..web designing
💻 ASP@OUTPUT=PRINT
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>XML DOM - Node object</title>
 
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />

<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

</head>
<body>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>


<h1>XML DOM - The Node Object</h1>

<a href="dom_nodetype.asp"><img border="0" src="../images/btn_previous.gif" alt="prev" width="100" height="20" /></a>
<a href="dom_nodelist.asp"><img border="0" src="../images/btn_next.gif" alt="next" width="100" height="20" /></a>

<hr />

<p class="intro">The Node object represents a node in the document tree.</p>

<hr />

<h2>The Node Object</h2>

<p>The Node object is the primary data type for the entire DOM.</p>
<p>The Node object represents a 
single node in the document tree.</p>
<p>A node can be an
element node, an attribute node, a text node, or any other of the node types explained in the 
&quot;Node 
types&quot; chapter.</p>
<p>Notice that while all objects inherits the Node properties / methods for 
dealing with parents and children, not all objects can have parents or children. 
For example, Text nodes may not have children, and adding children to such nodes 
results in a DOM error.</p>
<p>
<b>IE:</b> Internet Explorer, <b>F:</b> Firefox, <b>O:</b> Opera, <b>W3C:</b> 
World Wide Web Consortium (Internet Standard)</p>

<h3>Node Object Properties</h3>

<table border="1" width="100%" class="ex" cellspacing="0" id="table1">
<tr>
<th width="32%" align="left" valign="top">Property</th>
<th width="48%" align="left" valign="top">Description</th>
<th width="5%" align="left" valign="top">IE</th>
<th width="4%" align="left" valign="top">F</th>
<th width="4%" align="left" valign="top">O</th>
<th width="7%" align="left" valign="top">W3C</th>
</tr>
<tr>
	<td valign="top"><a href="prop_node_baseuri.asp">baseURI</a></td>
	<td valign="top">Returns the absolute base URI of a node</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_childnodes.asp">childNodes</a></td>
	<td valign="top">Returns a NodeList of child nodes for a node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_firstchild.asp">firstChild</a></td>
	<td valign="top">Returns the first child of a node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_lastchild.asp">lastChild</a></td>
	<td valign="top">Returns the last child of a node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_localname.asp">localName</a></td>
	<td valign="top">Returns the local part of the name of a node</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_namespaceuri.asp">namespaceURI</a></td>
	<td valign="top">Returns the namespace URI of a node</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_nextsibling.asp">nextSibling</a></td>
	<td valign="top">Returns the node immediately following a node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_nodename.asp">nodeName</a></td>
	<td valign="top">Returns the name of a node, depending on its type</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_nodetype.asp">nodeType</a></td>
	<td valign="top">Returns the type of a node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_nodevalue.asp">nodeValue</a></td>
	<td valign="top">Sets or returns the value of a node, depending on its 
	type</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_ownerdocument.asp">ownerDocument</a></td>
	<td valign="top">Returns the root element (document object) for a node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_parentnode.asp">parentNode</a></td>
	<td valign="top">Returns the parent node of a node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_prefix.asp">prefix</a></td>
	<td valign="top">Sets or returns the namespace prefix of a node</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_previoussibling.asp">previousSibling</a></td>
	<td valign="top">Returns the node immediately before a node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_textcontent.asp">textContent</a></td>
	<td valign="top">Sets or returns the textual content of a node and its 
	descendants</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_text.asp">text</a></td>
	<td valign="top">Returns the text of a node and its descendants. 
	IE-only property</td>
	<td valign="top">5</td>
	<td valign="top">No</td>
	<td valign="top">No</td>
	<td valign="top">No</td>
</tr>
<tr>
	<td valign="top"><a href="prop_node_xml.asp">xml</a></td>
	<td valign="top">Returns the XML of a node and its descendants. IE-only 
	property</td>
	<td valign="top">5</td>
	<td valign="top">No</td>
	<td valign="top">No</td>
	<td valign="top">No</td>
</tr>
</table>
<h3>Node Object Methods</h3>

<table border="1" width="100%" class="ex" cellspacing="0" id="table2">
<tr>
<th width="40%" align="left" valign="top">Method</th>
<th width="40%" align="left" valign="top">Description</th>
<th width="5%" align="left" valign="top">IE</th>
<th width="4%" align="left" valign="top">F</th>
<th width="4%" align="left" valign="top">O</th>
<th width="7%" align="left" valign="top">W3C</th>
</tr>
<tr>
	<td valign="top"><a href="met_node_appendchild.asp">appendChild()</a></td>
	<td valign="top">Adds a new child node to the end of the list of children of 
	a 
	node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_clonenode.asp">cloneNode()</a></td>
	<td valign="top">Clones a node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_comparedocumentposition.asp">compareDocumentPosition()</a></td>
	<td valign="top">Compares the document position of two nodes</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top">getFeature(feature,version)</td>
	<td valign="top">Returns a DOM object which implements the specialized APIs 
	of the specified feature and version</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top">getUserData(key)</td>
	<td valign="top">Returns the object associated to a key on a this node. The 
	object must first have been set to this node by calling setUserData with the 
	same key</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_hasattributes.asp">hasAttributes()</a></td>
	<td valign="top">Returns true if a node has any attributes, otherwise it 
	returns false</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_haschildnodes.asp">hasChildNodes()</a></td>
	<td valign="top">Returns true if a node has any child nodes, otherwise it 
	returns false</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_insertbefore.asp">insertBefore()</a></td>
	<td valign="top">Inserts a new child node before an existing child node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top">isDefaultNamespace(URI)</td>
	<td valign="top">Returns whether the specified namespaceURI is the default</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_isequalnode.asp">isEqualNode()</a></td>
	<td valign="top">Checks if two nodes are equal</td>
	<td valign="top">No</td>
	<td valign="top">No</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_issamenode.asp">isSameNode()</a></td>
	<td valign="top">Checks if two nodes are the same node</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top">isSupported(feature,version)</td>
	<td valign="top">Returns whether a specified feature is supported on a node</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_lookupnamespaceuri.asp">lookupNamespaceURI()</a></td>
	<td valign="top">Returns the namespace URI matching a specified prefix</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_lookupprefix.asp">lookupPrefix()</a></td>
	<td valign="top">Returns the prefix matching a specified namespace URI</td>
	<td valign="top">No</td>
	<td valign="top">1</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top">normalize()</td>
	<td valign="top">Puts all text nodes underneath a node (including 
	attributes) into a &quot;normal&quot; form where only structure (e.g., elements, 
	comments, processing instructions, CDATA sections, and entity references) 
	separates Text nodes, i.e., there are neither adjacent Text nodes nor empty 
	Text nodes</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_removechild.asp">removeChild()</a></td>
	<td valign="top">Removes a child node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top"><a href="met_node_replacechild.asp">replaceChild()</a></td>
	<td valign="top">Replaces a child node</td>
	<td valign="top">5</td>
	<td valign="top">1</td>
	<td valign="top">9</td>
	<td valign="top">Yes</td>
</tr>
<tr>
	<td valign="top">setUserData(key,data,handler)</td>
	<td valign="top">Associates an object to a key on a node</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">&nbsp;</td>
	<td valign="top">No</td>
	<td valign="top">Yes</td>
</tr>
</table>
<br />
<hr />

<a href="dom_nodetype.asp"><img border="0" src="../images/btn_previous.gif" alt="prev" width="100" height="20" /></a>
<a href="dom_nodelist.asp"><img border="0" src="../images/btn_next.gif" alt="next" width="100" height="20" /></a>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -