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 = "//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>


<p>This is sample text.</p>


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