Basic Syntax of jQuery
jQuery syntax structure is customized for choosing HTML components.
It performs some actions that triggered to the selected elements.
Example of the syntax of jQuery is given below:
$(context).action();
- $ is used to characterize jQuery
- context is to "find" HTML element.
- action() is for performing on the element.
Models:
$(this).hide() - hides the current component.
$("span").hide() - hides all <span> components.
$(".content").hide() - hides all components with class="content".
$("#content").hide() - hides the component with id="content".