Home »
MCQs »
jQuery MCQs
Write a jQuery statement to remove all <pre> elements with class='prog' and class='old'?
75. Write a jQuery statement to remove all <pre> elements with class="prog" and class="old"?
- $(".prog#old").remove();
- $("pre").empty(".prog",".old");
- $("pre").remove(".prog, .old");
- $("pre.prog.old").remove();
Answer: C) $("pre").remove(".prog, .old");
Explanation:
The jQuery statement to remove all <pre> elements with class="prog" and class="old" is:
$("pre").remove(".prog, .old");