Which is the correct jQuery selector to select the first list item of every <ul> element?

23. Which is the correct jQuery selector to select the first list item of every <ul> element?

  1. $("ul li:first-child")
  2. $("ul li:first.*")
  3. $("li:first-child")
  4. $("ul:first-child")

Answer: A) $("ul li:first-child")

Explanation:

The $("ul li:first-child") selector is used to select the first list item of every <ul> element.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.