element using jquery
Attach a click and double-click event to the <p> element using jquery
HTML Code :
<head> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <meta charset="utf-8"> <title>Attach a click and double-click event to the <p> element</title> </head> <body> <p>Click me!</p> <div id="result"></div> </body>
JavaScript Code :
$("p").bind("click", function(){ $( "<p>This is a click Event</p>").appendTo( "#result" ); }); $("p").bind("dblclick", function(){ $( "<p>This is a double-click Event</p>" ).appendTo( "#result" ); });
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
HTML Code :
JavaScript Code :