Home »
MCQs »
jQuery MCQs
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?
- $("a.[href]")
- $("a:[href]")
- $("[href].*")
- $("[href]")
Answer: D) $("[href]")
Explanation:
The $("[href]") selector is used to select all elements having href attribute.