Handle change event for Dropdown via onchange event attribute - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Select

Description

Handle change event for Dropdown via onchange event attribute

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <select id="taxdeduction" onchange="myfun()"> 
         <option value="2">Two Percent</option> 
         <option value="5">Five Percent</option> 
      </select> 
      <script>
function myfun()//  w w  w. j  a v  a2s .co m
{
    console.log("hii");
}

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

Related Tutorials