Open In App
Related Articles

jQuery Syntax

Improve Article
Save Article
Like Article

It is used for selecting elements in HTML and performing the action on those elements.


  • $ sign: It grants access to jQuery.
  • (selector): It is used to find HTML elements.
  • jQuery action(): It is used to perform actions on the elements.
    • Used to hide the current element.

    • Used to hide all <p> elements.

    • Used to hide all elements with class=”test”.

    • Used to hide the element with id=”test”.

    Document Ready Event:

    • jQuery Methods are inside a Document ready event for easy reading of code.

      // jQuery Method


      This is to check and stop the jquery before the document is finished loading. This method also allows you to have JavaScript code before the body of your document, in the head section.

    • Some actions that can fail if the method is run before the loaded document:
    • Get the image size that is not loaded or hide the element which is not been created yet.
    • The shorter method for document ready:

      // jQuery Method

  • Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

    Last Updated : 11 Jul, 2023
    Like Article
    Save Article
    Similar Reads
    Complete Tutorials