Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
38
rated 0 times [  43] [ 5]  / answers: 1 / hits: 71702  / 12 Years ago, thu, december 27, 2012, 12:00:00

Having a real hard time with this since I'm new to jQuery, but I'm not sure whether the tutorial I'm working on is broken or if it's me but I'm using the following code to select all li in an ul with a class of nav.



$(.nav ul li);


Is this correct? Could someone point me in the right direction?


More From » jquery

 Answers
6

Constructively,




  1. All ul elements:



    $(ul)

  2. All ul elements with a classname nav:



    $(ul.nav)

  3. All li elements under all ul elements with a classname nav:



    $(ul.nav li)


[#81197] Wednesday, December 26, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
juand

Total Points: 366
Total Questions: 95
Total Answers: 90

Location: Wallis and Futuna
Member since Tue, Mar 30, 2021
3 Years ago
;