// Advanced selectors
// And Modifying selections
//
// This exercise is intended to give you
// a feel for using modifiers on selections
// as well as the context selector
//
// Follow the instructions below to select each
// element and apply a style change to them
//
// .css("border", "1px solid red");
//
// 1.
// Get the unordered list (ul) that is NOT
// in #container
//$("body > ul").css("border", "1px solid red");
// 2.
// Get the unordered list that has a "span"
// inside it
//$("ul").has("span").css("border", "1px solid red");
// 3.
// Get the unordered list that is in #container
// Do so with the "context selector"
//using context selector:
$("ul", "#container").css("border", "1px solid red");
//not using context selector:
//$("#container ul").css("border", "1px solid red");
// 4a.
// Select all inputs and store them in a variable
// 4b.
// Within the input results, filter it for all text inputs
// 4c.
// Add input types of "date" to your previous selection
// 5a.
// Get all fieldsets (store this for use later)
// 5b.
// Find all h2 elements inside the fieldset result from 5a
// 5c.
// Write the above as a "context selection" instead
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.