📄 dom_nodes.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><html>
<head>
<title>DOM Tutorial</title>
</head>
<body>
<h1>DOM Lesson one</h1>
<p>Hello world!</p>
</body>
</html></pre>
</td>
</tr>
</table>
<p>The root node in the HTML above is <html>. All other nodes in the document
are contained within <html>.</p>
<p>The <html> node has two child nodes; <head> and <body>.</p>
<p>The <head> node holds a <title> node. The <body> node holds a <h1> and <p>
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><title>DOM Tutorial</title></b>, the element node
<title>, holds a text node with the value "DOM Tutorial". </p>
<p>"DOM Tutorial" is <b>not</b> the value of the <title> 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 + -