Skip to content

Instantly share code, notes, and snippets.

@jeffpowrs
Created January 19, 2017 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffpowrs/6e20b48f139a7d084f30b118afa5a4da to your computer and use it in GitHub Desktop.
Save jeffpowrs/6e20b48f139a7d084f30b118afa5a4da to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=6e20b48f139a7d084f30b118afa5a4da
<!DOCTYPE html>
<html>
<head>
<title>Parts of Speech: We Do</title>
</head>
<body>
<h1 id = "header">This page is about using variables with jQuery.</h1>
<div id="background">
<div id ="sentence"></div>
</div>
</body>
</html>
/*
YOU DO: Variable & jQuery practice
*/
// Challenge #1
// Create a variable that holds a CSS color.
// for example "blue"
// Challenge #2
// FIRST Use jQuery to select the HTML element with the ID of background.
// ** Remember that the ID is CASE-SENSITIVE.
// THEN append the variable's value inside of the HTML element you selected
// using jQuery.
// Challenge #3
// FIRST Use jQuery to select the HTML element with the ID of "background" again.
// ** Remember that the ID is CASE-SENSITIVE.
// THEN set the "background-color" of the HTML element to the variable's value
// using jQuery.
#header{
color: red;
}
#background {
height: 600px;
outline: 1px solid black;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment