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

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

<p class="intro">In the DOM, everything in an HTML document is a node.</p>

<hr />

<h2>Nodes</h2>

<p>According to the DOM, everything in an HTML document is a node.</p>
<p>The DOM says:</p>
<ul>
	<li>The 
entire document is a document node</li>
	<li>Every HTML tag is an element node</li>
	<li>The text in the HTML elements are text 
nodes</li>
	<li>Every HTML attribute is an attribute node</li>
	<li>Comments are comment nodes</li>
</ul>

<hr />

<h2>DOM Example</h2>
<p>Look at the following HTML document:</p>
<table class="ex" id="table1" 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>The root node in the HTML above is &lt;html&gt;. All other nodes in the document 
are contained within &lt;html&gt;.</p>
<p>The &lt;html&gt; node has two child nodes; &lt;head&gt; and &lt;body&gt;.</p>
<p>The &lt;head&gt; node holds a &lt;title&gt; node. The &lt;body&gt; node holds a &lt;h1&gt; and &lt;p&gt; 
node.</p><hr  />
<h2>Text is Always Stored in Text Nodes</h2>
<p>A common error in DOM processing is to expect an element node to contain 
text. </p>
<p>However, the text of an element node is stored in a text node.</p>
<p>In this example: <b>&lt;title&gt;DOM Tutorial&lt;/title&gt;</b>, the element node 
&lt;title&gt;, holds a text node with the value &quot;DOM Tutorial&quot;. </p>
<p>&quot;DOM Tutorial&quot; is <b>not</b> the value of the &lt;title&gt; element!</p>
<p>However, in the HTML DOM the value of the text node can be accessed by the 
<b>innerHTML</b> property.</p>
<p>You can read more about the innerHTML property in a later chapter.</p>

<hr />
<a href="default.asp"><img border="0" alt="previous" src="../images/btn_previous.gif" width="100" height="20" /></a>
<a href="dom_nodetree.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 + -