Which is the correct jQuery selector to select all elements having 'href' attribute?

24. Which is the correct jQuery selector to select all elements having "href" attribute?

  1. $("a.[href]")
  2. $("a:[href]")
  3. $("[href].*")
  4. $("[href]")

Answer: D) $("[href]")

Explanation:

The $("[href]") selector is used to select all elements having href attribute.

Comments and Discussions!

Load comments ↻






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