Title: Quiz Week 12 jQuery
Course: Fall 2023 - WEBD 164 (41934) > Section: Week 12 (Nov 6) Using jQuery Effects

Q: Which of the below choices will set the CSS "color" property to the value of "red" for ONLY the first <h2> element...

<div id="xyz">
<h2>Some Text Here</h2>
<h2>Some More Text Here</h2>
</div>
- $("h2:first-child").css("color" ,  "red");
- $("div h2:first").css("color"  ,  "red");
- $("div h2:first-child").css("color"  ,  "red");
- All three work!
A: All three work!

Q: Which of the below choices will remove the class named "format" for the <h2> element...

<head>
<style>
.format {color: red;}
</style>
</head>
<body>

<div id="xyz">

<h2 id="firstHead" class="format">Some Text Here</h2>

</div>
- $("#firstHead").removeClass(".format");
- $("#firstHead").removeClass(format);
- $("#firstHead").css("format", " ");
- $("#firstHead").removeClass("format");
A: $("#firstHead").removeClass("format");

Q: Which of the below choices will set the CSS "color" property to the value of "red" AND also set the the "background-color" property to the value of  "yellow" for the <h2> element...

<div id="xyz">
<h2>Some Text Here</h2>
</div>
- $("h2").css( {"color" :  "red",  "background-color" : "yellow" } );
- $("h2").css( "color" :  "red",  "background-color" : "yellow"  );
- $("h2").css( "color" ,  "red" :  "background-color" , "yellow"  );
- $("h2").css{"color" :  "red",  "background-color" : "yellow" };
A: $("h2").css( {"color" :  "red",  "background-color" : "yellow" } );

Q: A useful jQuery method that allows us to loop through a group of the same type of selectors is...
- loop()
- each()
- for()
- select()
A: each()

Q: A jQuery filter allows you to refine the element that you are selecting. Which of the below is NOT a jQuery filter?
- :middle
- :first
- :odd
- :contains()
A: :middle