jQuery syntax is predefined and can be used to select and manipulate HTML elements.

jQuery Syntax


  • The $ sign is used to access the jQuery function.
  • The $ sign is an alias to jQuery()
  • A (selector) is used to find and select the element from the DOM.
  • jQuery uses CSS syntax to select the element(s).
  • action() performs the action on the selected element(s).

You can use jQuery instead of a $ symbol because the $ symbol is a synonym of jQuery.

jQuery Example with HTML


<!DOCTYPE html>

        <title>jQuery with HTML Example</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

            $(document).ready(function() {
                $("p").click(function() {
        <p>This is sample text.</p>


In the above example, the paragraph will disappear on click.

Found This Page Useful? Share It!
Get the Latest Tutorials and Updates
Join us on Telegram