Language References
Retrieves the name of the element type.
HTML |
N/A |
Script |
[ sName = ] object.tagName |
sName |
String containing the object’s tag name. |
The property is read-only with no default value.
The following example retrieves the tagName for an object that has the identifier that was specified in the prompt window.
<script language="JavaScript">
var idVal = window.prompt (
"Get the tag with this ID: " );
if ( idVal != null ) {
alert ( document.all [ idVal ] .tagName )
}
</script>