Handle Span Click event - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Span

Description

Handle Span Click event

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <div class="checkboxBtn"> 
         <input id="23" type="checkbox"> 
         <span class="cheked" onclick="CheckSelected();"> 
            <label>Compare Now </label> 
         </span> 
      </div> 
      <script type="text/javascript">
function CheckSelected() {/*from   www  .  j ava 2  s.  c o  m*/
    console.log("hi");
}

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

Related Tutorials