An Example of Changing Event Handlers : General Event : Event JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Event » General Event »

 

An Example of Changing Event Handlers



<html>
<head>
<script language="JavaScript">     var choice = "A"
     function optionA() {
      alert('optionA' );  
     }
   
     function optionB() {
        alert('optionB' );  
     }
     
</script>
</head>
<body>
   
<form name="form1">
<input type="button" name="button1"  onClick="optionA()">
</form>   
<script language="JavaScript">
     if (choice != "A") {
          document.form1.button1.onclick=optionB
     }
</script>
</body>
</html>

           
       



-

Leave a Comment / Note


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

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Event
» General Event