Consider following HTML snippet:

<div>
   <span style="display:none;">A</span>
   <span>B</span>
   <span id="dog">C</span>
</div>
How many <span> elements will be displayed on the page after execution following jQuery code snippet?

$("#dog").hide().parent().children().show();
Explanation

    $("#dog").hide() // hide the #dog element
            .parent()  // select div element
            .children() // select of child elements of a div element
            .show(); // show all selected child elements 

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
JavaScript quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes