♦ Element Selector in jQuery
♣ Example1: Element Selector in jQuery
The element selector selects the element based on the tag name of the HTML element.For example selection of div,p,h1 tags can be done.
Below is an example of a HTML element
Note that all the elements with the element name provide will be selected and the specified action will be performed on them.
Basic Syntax
Elements are selected by writing a simply the name of the element followed by element to be selected.
Below is the representation of Element Selector Syntax.
$("demo")
Below is the representation of Element Selector Syntax.
$("demo")
Syntax Explanation:
demo : the tag element for selection
In this example, . Example
Input:
Output: