What should be the first line of your HTML files?
1. <!doctype html>
2. <body>
3. <html>
4. <head>
1. <!doctype html>
If we want to target the ID of an HTML element with a CSS selector, the selector will have to start with this character.
#
What symbol would you use to call jQuery?
$ <-- The Dollar Symbol
Declare a variable named variableName.
var variableName;
The name of this function:
function addToJeopardyScore() { }
addToJeopardyScore
Give an example of an HTML attribute.
src, alt, href, ...
Give an example of a CSS property.
width, color, font-size, opacity, ...
Using jQuery, how would you select all elements with the class of "danger" on the webpage?
$(".danger")
This is how you would access the 2nd element of an array with the name of arr.
arr[1]
What is the data type of: 132?
Number
Which of the following elements will create a hyperlink on a webpage that when clicked will take the user to google.com?
1. <a href="http://www.google.com">Google</a>
2. <a src="http://www.google.com">Google</a>
3. <a name="Google">http://www.google.com</a>
4. <link href="http://www.google.com">Google</link>
5. <link src="http://www.google.com">Google</link>
6. <link name="Google">http://www.google.com</link>
1. <a href="http://www.google.com">Google</a>
Fill in the blanks. In the following CSS rule, "img" is a __________, "width" is a __________, and "100px" is a __________.
img { width: 100px; }
(1) selector (2) property (3) value
Write the jQuery that would grab the value of an input from the element with an id of userInput.
$("#userInput").val();
Name the operators you'd use to do addition, subtraction, multiplication, and division in JavaScript
Addition + Subtraction - Multiplication * Division /
Write it! Create a function named average with the parameters of x and y. Have that function return the average of those two parameters.
function average(x,y){
var avg=(x+y)/2
return avg
}
What is the correct HTML for inserting an image?
1. <img href="image.gif" alt="MyImage">
2. <image src="image.gif" alt="MyImage">
3. <img alt="MyImage">image.gif</img>
4. <img src="image.gif" alt="MyImage">
4. <img src="image.gif" alt="MyImage">
Given the following HTML, write a CSS rule that targets ONLY the second image and sets its width property to 200px.
<img class="largeImages" src="pic1.jpg">
<img class="largeImages" id="second" src="pic2.jpg">
<img id="third" src="pic3.jpg">
#second { width: 200px; }
Find the errors.
$("button").function(click){
$("p").css("blue","color");
});
$("button").click(function(){
$("p").css("color","blue");
});
Write it! Create a function named average with the parameters of x and y. Have that function return the average of those two parameters.
function average(x,y){
var avg=(x+y)/2
return avg
}
Using a loop log each element in the array to the console.
var fruits=["apple","pear","orange"];
var fruits=["apple","pear","orange"];
fruits.forEach(function(fruit){
console.log(fruit);
});
What is the correct HTML for creating a hyperlink?
1. <a>http://www.w3schools.com</a>
2. <a name="http://www.w3schools.com">W3Schools.com</a>
3. <a href="http://www.w3schools.com">W3Schools</a>
4. <a url="http://www.w3schools.com">W3Schools.com</a>
3. <a href="http://www.w3schools.com">W3Schools</a>
What's wrong with the following CSS rule?
p ( color - blue )
1.Uses parentheses instead of curly-braces.
2. Uses "-" instead of ":" between color and blue.
3. No semi-colon after blue.
Write it: When a button with the class of clickMe is pressed, an image with the src "pup.png" should be appended to all elements with the id of "priority".
$(".clickMe").click(function(){
$("#priority").append("<img src='pup.png'>");
});
Define an array that contains a number, a string, and an array.
var a = [1, "a string", ["an", "array"]];
var height = 70;
function printHeight(){
height = 100;
console.log(height);
}
printHeight(20);
What will happen when this function runs?
100