jQuery: Test if jQuery is loaded

jQuery Practical exercise Part - I: Exercise-1

Test if jQuery is loaded.

Sample solution:

HTML Code:

<!DOCTYPE html>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  <meta charset="utf-8">
  <title>Test if jQuery is loaded</title>
<p>Click me!</p>

JavaScript Code :

$("p").bind("click", function(){
   $( "
This is a click Event
").appendTo( "body" ); }); $("p").bind("dblclick", function(){ $( "
This is a double-click Event
" ).appendTo( "body" ); });

See the Pen jquery-practical-exercise-1 by w3resource (@w3resource) on CodePen.

Contribute your code and comments through Disqus.

Previous: jQuery Practical exercises
Next: Scroll to the top of the page with jQuery.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.

Follow us on Facebook and Twitter for latest update.