I have a question regarding jQuery.
What is an example of type selector?
1) h1
2) .h1
3) #h1
4) div h1
5) div>h1
Can anybody tell me what would be the correct answer?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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
h1elements 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 treediv h1
Example:
$("div h1")The above rule selects all
divelements havingh1elements in the document treediv > h1
Example:
$("div > h1")The above rule selects all
h1elements that are children ofdivelement in the document tree