Gets the name of a particular type of node.
Syntax
| JavaScript | |
|---|
Property values
Type: String
tagName
-
The name of the element. This name is also available through the tagName property.
attrName
-
The name of the attribute, where the node is an attribute object.
#text
-
The node is a TextNode object.
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 1.2
Examples
The following code example uses the nodeName property to obtain the name of an element.
<SCRIPT> // returns the element name 'LI' of the list item labeled 'List Item 2' var sName = oList.childNodes(1).nodeName; </SCRIPT> <BODY> <UL ID = oList> <LI>List Item 1 <LI>List Item 2 <LI>List Item 3 </UL> </BODY>
See also
- a
- abbr
- address
- area
- attribute
- b
- base
- bdo
- blockQuote
- body
- br
- button
- caption
- cite
- code
- col
- colGroup
- comment
- dd
- del
- div
- dl
- documentType
- dt
- em
- embed
- fieldSet
- form
- 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
- kbd
- label
- legend
- li
- link
- map
- object
- ol
- option
- p
- pre
- ProcessingInstruction
- q
- s
- samp
- script
- select
- small
- span
- strong
- sub
- sup
- table
- tBody
- td
- textArea
- TextNode
- tFoot
- th
- tHead
- title
- tr
- u
- ul
- var
- nodeType
- About the W3C Document Object Model
Build date: 11/28/2012