A type selector matches the name of a document language element type. A type selector matches every instance of the element type in the document tree.
h1
Example: $("h1")
The above rule selects all h1
elements in the document tree
.h1
Example: $(".h1")
The above rule selects all elements having attribute class="h1"
in the document tree
#h1
Example: $("#h1")
The above rule selects all elements having attribute id="h1"
in the document tree
div h1
Example: $("div h1")
The above rule selects all div
elements having h1
elements in the document tree
div > h1
Example: $("div > h1")
The above rule selects all h1
elements that are children of div
element in the document tree
1
solved which is the example of type selector