// Selector Matching
//
// Use jQuery to select the element
// confirm your match by setting the background
// on the element
//
// You can use this pattern to set the color:
// $("selector").css("backgroundColor", "red");
//
// 1) the container div
//$("div#container").css("backgroundColor", "red");
// 2) the heading (h1)
//$("h1").css("backgroundColor", "red");
// 3) the form
//$("form").css("backgroundColor", "red");
// 4) all hidden inputs
//$(":hidden").attr('type', 'text').css("backgroundColor", "red");
// 5) all fieldsets
//$("fieldset").css("backgroundColor", "red");
// 6) Just the first fieldset
//$("fieldset:first").css("backgroundColor", "red");
// 7) the username input field
//$("fieldset input:first").css("backgroundColor", "red");
// 8) the email input field
//$("fieldset input#email-field").css("backgroundColor", "red");
// 9) the second fieldset only
//$("fieldset:nth-child(3)").css("backgroundColor", "red");
//$("fieldset:eq(1)").css("backgroundColor", "red");
// 10) all input fields
//$("input").css("backgroundColor", "red");
// 11) all inputs in the second fieldset
//$("fieldset:nth-child(3) input").css("backgroundColor", "red");
// 12) all paragraphs in the footer
//$("div.footer p").css("backgroundColor", "red");
// 13) the table header row
//$("th").css("backgroundColor", "red");
// 14) the first cell in the first row of the table body
//$("table tbody td:first").css("backgroundColor", "red");
// 15) the third cell in the second row of the table
//$("table tbody td:eq(5)").css("backgroundColor", "red");
// 16) the second column in the table (hint:you will use "nth-child()")
//$("table tbody td:nth-child(2)").css("backgroundColor", "red");
// 17) all odd rows in the table
//$("table tbody tr:even td").css("backgroundColor", "red");
// 18) all unordered lists within an unordered list
//$("ul ul").css("backgroundColor", "red");
// 19) only paragraphs that are a direct child of the footer div
//$("div.footer >...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.