Button parentNode Example : Button : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Button »

 

Button parentNode Example



    
<html>
<body>
<form id="myForm">
    <input id="myButton" type="button" value="Show parent node" onclick="function1();">
</form>
<script language="JavaScript">
function function1() {
    var m = document.all.myButton.parentNode.id;
    alert("Parent node: <form>, id = "+'"'+m+'"')

</script>
</body>
</html>

    
      
      



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Button