JavaScript Reference/Javascript Properties/nodeName — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:21, 26 мая 2010
Содержание
"nodeName" Example
<html>
<body>
<script language="JavaScript">
function function2() {
alert(document.all.myNodeOne.nodeName);
}
</script>
<p>This PARAGRAPH has two nodes,
<b id="myNodeOne">Node One</b>, and
<b id="myNodeTwo">Node Two</b>.
</p>
<button onclick="function2();">Node One Name</button>
</body>
</html>
"nodeName" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<a> <acronym> |
| |<address> <applet> |
| |<area> attribute |
| |<b> <base> |
| |<basefont> <bdo> |
| |<bgsound> <big> |
| |<blockquote> <body> |
| |<br> <button> |
| |<caption> <center> |
| |<cite> <code> |
| |<col> <colgroup> |
| |<comment> <dd> |
| |<del> <dfn> |
| |<dir> <div> |
| |<dl> <dt> |
| |<em> <embed> |
| |<fieldset> <font> |
| |<form> <frame> |
| |<frameset> <head> |
| |<hn> <hr> |
| |<html> <i> |
| |<iframe> <img> |
| |<input type="button"> <input type="checkbox"> |
| |<input type="file"> <input type="hidden"> |
| |<input type="image"> <input type="password"> |
| |<input type="radio"> <input type="reset"> |
| |<input type="submit"> <input type="text"> |
| |<ins> <isindex> |
| |<kbd> <label> |
| |<legend> <li> |
| |<link> <listing> |
| |<map> <marquee> |
| |<menu> <meta> |
| |<noframes> <noscript> |
| |<object> <ol> |
| |<optgroup> <option> |
| |<p> <param> |
| |<plaintext> <pre> |
| |<q> <s> |
| |<samp> <script> |
| |<select> <small> |
| |<span> <strike> |
| |<strong> <style> |
| |<sub> <sup> |
| |<table> <tbody> |
| |<td> <textarea> |
| |TextNode <tfoot> |
| |<th> <thead> |
| |<title> <tr> |
| |<tt> <u> |
| |<ul> <var> |
| |<xmp> |
+----------------+--------------------------------------------------------------+
"nodeName" Possible Values
Possible Values
The tag name for a regular node,
the attribute name for an attribute node,
#text for the text content of an element (text node).
"nodeName" Syntax and Note
Note:
Read-only property.
Returns the node name.
Syntax:
document.getElementById("elementID").nodeName
document.all.elementID.nodeName // IE only