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

📄 dom_nodetree.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>HTML DOM Node Tree</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>HTML DOM Node Tree</h1><a href="dom_nodes.asp"><img border="0" alt="previous" src="../images/btn_previous.gif" /></a>
<a href="dom_methods.asp"><img border="0" alt="next" src="../images/btn_next.gif" width="100" height="20" /></a>
<hr />

<p class="intro">The HTML DOM views a HTML document as a node-tree.</p>
<p class="intro">All the nodes in a node tree have relationships to each other.</p>

<hr />

<h2>The HTML DOM Node Tree (Document Tree)</h2>
<p>The HTML DOM views a HTML document as a tree-structure. The tree structure is 
called a <b>node-tree.</b></p>
<p>All nodes can be accessed through the tree. Their contents can be modified or 
deleted, and new elements can be created.</p>
<p>The node tree below shows the set of nodes, and the connections between them. 
The tree starts at the root node and branches out to the text nodes at the 
lowest level of the tree:</p>
<p>
<img border="0" src="htmltree.gif" alt="DOM HTML tree" width="486" height="266" />
</p><hr  />
<h2>Node Parents, Children, and Siblings</h2>
<p>The nodes in the node tree have a hierarchical relationship to each other.</p>
<p>The terms parent, child, and sibling are used to describe the relationships. 
Parent nodes have children. Children on the same level are called siblings 
(brothers or sisters). </p>
<ul>
	<li>In a node tree, the top node is called the root</li>
	<li>Every node, except the root, has exactly one parent node</li>
	<li>A node can have any number of children</li>
	<li>A leaf is a node with no children</li>
	<li>Siblings are nodes with the same parent</li>
</ul>
<p>Look at the following HTML fragment:</p>
<table class="ex" id="table2" cellspacing="0" width="100%" border="1">
<tr>
<td valign="top">
<pre>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;DOM Tutorial&lt;/title&gt; 
  &lt;/head&gt;
  &lt;body&gt; 
    &lt;h1&gt;DOM Lesson one&lt;/h1&gt; 
    &lt;p&gt;Hello world!&lt;/p&gt; 
  &lt;/body&gt; 
&lt;/html&gt;</pre>
</td>
</tr>
</table>

<p>In the HTML above, every 
node except for the document node has a parent node:</p>
<ul>
	<li>The &lt;html&gt; node has no parent node; the root node</li>
	<li>The parent node of 
the &lt;head&gt; and &lt;body&gt; nodes is the &lt;html&gt; node</li>
	<li>The parent node of the &quot;Hello world!&quot; text node is the &lt;p&gt; node</li>
</ul>
<p>Most element nodes have child nodes:</p>
<ul>
	<li>The &lt;html&gt; node has two child nodes; &lt;head&gt; and &lt;body&gt;</li>
	<li>The &lt;head&gt; node has one 
child node; the &lt;title&gt; node</li>
	<li>The &lt;title&gt; node also has one child 
node; the text node &quot;DOM Tutorial&quot;</li>
	<li>The &lt;h1&gt; and &lt;p&gt; nodes are siblings, and both child nodes of &lt;body&gt;</li>
</ul>

<hr />
<a href="dom_nodes.asp"><img border="0" alt="previous" src="../images/btn_previous.gif" width="100" height="20" /></a>
<a href="dom_methods.asp"><img border="0" alt="next" src="../images/btn_next.gif" width="100" height="20" /></a>
<hr />

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

</body>
</html>

⌨️ 快捷键说明

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