Vidyalelo
JavaScript · Q154

Document Object Model And Event Handling

Programming · JavaScript · question 154

Q154

Which is the code that asks for the set of all div elements in a document?

A.
var divs = $(div);
B.
var divs = jQuery("div");
C.
var divs = $("div");
Answer
D.
var divs = #("div");

Answer: Option C

Solution

Answer: Option C
Solution:
The code to ask for the set of all div elements in a document is
var divs = $("div");