Demonstrate the different selectors in jQuery like elements, class, attribute etc.
Ex.
$("[href]") // elements with href attribute
$(".mindstick") // elements with class="mindstick"
$("#myname") // elements with id="myname"
$("[title^='prakash']") // elements with attribute which start with "prakash".
Id and elements are faster than class selector because id will be unique and it's only one time matched data with DOM's database than stoped , but when you uses class it's called many times from DB and it's performance will get slow.
Happy Coding :)
Liked By
Write Answer
jquery selectors
Join MindStick Community
You have need login or register for voting of answers or question.
Prakash nidhi Verma
06-Jun-2018jQuery selectors:
Demonstrate the different selectors in jQuery like elements, class, attribute etc.
Ex.
Id and elements are faster than class selector because id will be unique and it's only one time matched data with DOM's database than stoped , but when you uses class it's called many times from DB and it's performance will get slow.
Happy Coding :)