The class refers to the class attribute of an HTML element. If it's not throwing an error about being unable to find the element, then it's not having an issue with the selector. JQuery | Set the value of an input text field. Use of them does not imply any affiliation with or endorsement by them. this would be a parent div where the strong tag is nested exactly 3 divs below it. How should I code the selector for this? About Us; Donation Policy; What We Do; Refund Donation About Us. When another selector is attached to the id selector, such as h2#pageTitle, jQuery performs an additional check before identifying the element as a match. Interview Preparation Course; Data Science (Live) GATE CS 2023 Test Series; Data Structure & Algorithm-Self Paced(C++/JAVA) Data Structures & Algorithms in Python; Explore More Self-Paced If your website contains a lot of pages, and you want your jQuery functions to be easy According to the jQuery selector performance documentation, it's faster to use the two selectors separately, like this: $ ('#my_id').find ('.my_class') Here's the relevant part of the documentation: ID-Based Selectors // Fast: $ ( "#container div.robotarm" ); // Super-fast: $ ( "#container" ).find ( "div.robotarm" ); For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. some own custom selectors. Data Structure & Algorithm Classes (Live) System Design (Live) DevOps(Live) Explore More Live Courses; For Students. Setting "checked" for a checkbox with jQuery. While using W3Schools, you agree to have read and accepted our, , Selects all

elements with class="intro", Selects the first

  • element of the first