First way:
$(document).ready(function(){ $("#clickme").click(function(){ alert("Hello World click"); });
The second way:
$('#clickmebind').bind("click", function(){ alert("Hello World bind"); });
The third way:
$('#clickmeon').on('click', function(){ alert("Hello World on"); }); });
Note: The third method is only applicable to jquery 1.7 or above
The source code is as follows: