Add this-button with click-event handler - Javascript jQuery

Javascript examples for jQuery:Form Button

Description

Add this-button with click-event handler

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-1.6.4.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//  w  w  w .j ava2 s .c o m
$('.mylittlebutton').live('click', function () {
    $(this).clone().appendTo($('#container'));
});
    });

      </script> 
 </head> 
 <body> 
  <div id="container"> 
   <input type="button" class="mylittlebutton" value="CLICK ME"> 
  </div>  
 </body>
</html>

Related Tutorials