Button parent Element : Button : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Button »

 

Button parent Element



    
<html>
<body>
<form id="myF">
<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>

    
      
      



-

Leave a Comment / Note


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

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Button