Parent Tag name : id « Javascript Properties « JavaScript DHTML






Parent Tag name

 

<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
function tagInfo() 
{
    var tag;
    tag = " Parent:" + window.event.srcElement.parentElement.tagName;
    window.status = tag;
}
</script>
</head>
<body onMouseover="tagInfo()" id="body1">
<h1 id="head1">Heading One</h1>
<p id="para1">Some text</p>
</body>
</html>

   
  








Related examples in the same category

1.Element name and id