How jQuery selectors are executed?

Answer Posted / chaitanya

Your last selectors is always executed first. For example, in below jQuery code, jQuery will first find all the elements with class ".myCssClass" and after that it will reject all the other elements which are not in "p#elmID".

Hide Copy Code

$("p#elmID .myCssClass");

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can jquery library be added to pages? Write a basic jquery code?

474


What is queue() in jquery?

483


What is jquery connect and how to use it?

540


Is it too early to discuss jquery ui 1.8?

522


How to get the style property of an element using ?

420






What is the purpose of fadetoggle() method in jquery?

435


How to keep the submit text from showing with jquery mobile? : jquery mobile

432


What does the jQuery migrate function do?

500


Explain jquery connect?

3761


How we can select multiple elements in jquery?

490


Which one is more efficient, document.getElementbyId( "myId") or $("#myId)?

506


Tell me an example usage of jquery mobile? : jquery mobile

470


Is vanilla js faster than jquery?

462


what does $("div") will select? : jquery mobile

465


Jumping off of jquery ui for a second, do you 'release early, release often' with all of your projects? What are your thoughts on that strategy?

499