Windows Dev Center

all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize

tagName property

Retrieves the tag name of the object.

Syntax

JavaScript

p = object.tagName

 

Property values

Type: String

the tag name.

Standards information

Examples

This example retrieves the tag name of an object that has the identifier specified in the prompt window.


<script type="text/javascript">
var idValue = window.prompt("Get the tag with this ID:");
if (idValue != null) {
    console.log(document.all[idValue].tagName)
}
</script>

See also

a
abbr
address
area
article
aside
b
bdo
blockQuote
body
br
button
caption
cite
code
col
colGroup
custom
dd
del
dfn
div
dl
dt
em
embed
fieldSet
figcaption
figure
footer
form
frame
head
header
hgroup
hn
hr
html
i
iframe
img
input type=button
input type=checkbox
input type=email
input type=file
input type=hidden
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
ins
kbd
label
legend
li
map
mark
menu
nav
object
ol
optGroup
option
p
pre
q
rt
ruby
s
samp
section
select
small
span
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
tr
u
ul
var

 

 

Show:
© 2015 Microsoft