Call function with onclick attribute - Javascript DOM Event

Javascript examples for DOM Event:onclick

Description

Call function with onclick attribute

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width"> 
   </head> 
   <body> 
      <button onclick="test21()">test</button> 
      <script>
    function test21(){// w  ww.  ja va 2  s .  com
      console.log("yey");
    }
  
      </script>  
   </body>
</html>

Related Tutorials