JQUERY
  • jQuery Introduction
  • jQuery Detecting Clicks
  • jQuery Styling , Fading and Animation
  • jQuery AJAX
  • jQuery Regular Expressions
  • jQuery UI Widgets
  • jQuery UI Interactions
  • jQuery Changing the Webpage Content

jQuery Introduction



jQuery is a lightweight, "write less, do more", JavaScript library. The purpose of jQuery is to make it much easier to use JavaScript on your website. jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code. jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

The jQuery library contains the following features :

  • HTML/DOM manipulation
  • CSS manipulation
  • HTML event methods
  • Effects and animations
  • AJAX
  • Utilities

Embedding jQuery

To use jQuery in our html file we need to embed jQuery in the required file which can be done in 2 ways :

  1. We can include it from a CDN (Content Delivery Network). Google apis host the jquery. We just need to include the given code in the head tag of html file.
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

     

  2. We can download jQuery from here and include the given code in the head tag of html file.
    <script src="jquery.min.js"></script>

     

Code to check if jQuery is embeded correctly

<html>
<head>
  <title>jQuery</title>
  <script src="jquery.min.js"></script>
</head>
<body>
  hello
  <script>
      if(typeof jQuery == 'undefined') {
      alert("jQuery is not installed properly");
      }
      else {
      alert("jQuery in installed properly");
      }
  </script>
</body>
</html>