Interviews2 answers
Explain jQuery Selectors .
2 Answers
# for I'd
. For class
Div for tag
Bipin TiwariPosted Jan 12, 2020, 8:01 AM EST
A jQuery Selector is a function which makes use of expressions to find out matching elements from a DOM based on the given criteria.
All type of selectors available in jQuery, always start with the dollar sign and parentheses: $().
Some selectors are following.
(1) * $("*") Selects All elements
(2) #id $("#lastname") Selects The element with id="lastname"
(3) .class $(".intro") Selects All elements with class="intro"
(4) .class,.class $(".intro,.demo") Selects All elements with the class "intro" or "demo"
(5) element $("p") Selects All
elements
Krishna KumarPosted Oct 31, 2014, 7:19 PM EDT
