Use CLICK event to call .html() - Javascript jQuery

Javascript examples for jQuery:Mouse Event

Description

Use CLICK event to call .html()

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from   w w w.ja  v a  2  s  . c o  m
$("#circle").click(function(){
    $("p").html("Changed");
});
    });

      </script> 
   </head> 
   <body> 
      <div id="circle">
         I am a circle
      </div> 
      <p>THIS IS A CIRCLE</p>  
   </body>
</html>

Related Tutorials