JavaScript Reference/Javascript Properties/parentElement
"parentElement" Example
<source lang="javascript">
<html> <body> <form id="myForm"> <input id="myButton"
type="button" value="Show my parent" onclick="function1();">
</form> <script language="JavaScript">
function function1() { var m = document.all.myButton.parentElement.id; alert("Parent element: <FORM>, ID = "+"""+m+"""); }
</script>
</source>
"parentElement" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | |<address> <applet> | | |<area> | | |<base> <basefont> | | | <bgsound> |
| ||| |<body>
| | |<button>| | | | | |
| |<dir><col> | | |<colgroup> <comment> | | |<custom>
| | | || | |
- | | | <embed> | | |<fieldset> | | |<form> <frame> | | |<frameset> <head> | | |<hn>
|| |<html> | | |<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"> | | | <isindex> | | | <label> |
| |<legend>- | | |<link> <listing> | | |<map> <marquee> | | |<menu> <nobr> | | |<noframes> <noscript> | | |<object>
| | |<option>
| | |<plaintext>
| | |