Sample code “Hello World” – JQuery

JQuery Hello world Example

  • To do this, we register a ready event for the document.

$(document).ready(function() {
// do stuff when DOM is ready
});

  • Add the following to the :

Link

  • Now update the $(document).ready handler:

$(document).ready(function() {
$("a").click(function() {
alert("Hello world!");
});
});

 

 

  • This is similar to the following code:

Link