jQuery
More jQuery
Variables
Input
100

What character does every jQuery statement begin with?

$

100

When will the alert be triggered?

$("button").click(function () {
    alert("hello");
}

When the button is clicked 

100

Declare a variable called school and set its value to the name of your school.

var school = "Name of Our School";
100

Write the HTML code for a input text box and give it the class of score

<input class="score">

200

Write a jQuery selector to select a <p> tag.

Bonus for 100 points:

Write a jQuery selector to select a <p class="blue"> tag by its class.

$("p")

$(".blue")

200

What is the name of the event when the user places their mouse cursor on an element?

.hover()

200

Set the value of a variable named numOfPeople to the sum of 5 and 6. 

numOfPeople = 5 + 6;
200

Please write the code required to get the value from an input box

<input>

$("input").val();

300

Name as many jQuery actions as you can

(50 points each)

.hide(), .show(), .toggle(), .slide(), .fade(), .css(), .text(), .append(), slideDown(), slideUp(), slideToggle(), fadeIn(), fadeOut()

300

Write the code to change the text in the paragraph to "Goodbye"

<p class="message">Hello</p>

$(".message").text("Goodbye");

300

If the value of price is 200, what is the value of the variable of total after the following line of code?

total = price + "10";


20010

300

In the following line of code, where is value that we get from the text box being stored?

$("input").val();

It isn't stored anywhere. Instead, we should put it in a variable:

var password = $("input").val();

400

Name as many jQuery events as you can

(50 points each)

.click(), .hover(), .mouseenter(), .mouseleave(), dblclick()

400

Write the code to add the word "movies" to the paragraph.

<p class="message">Let's go to the </p>

$(".message").append("movies");

400

If the value of the variable name is "Jeff", please create a new variable called greeting, and set its' value to "Hello, Jeff" using the variable name.

var greeting = "Hello, " + name;
400

With the following HTML:

<input class="age">

Write a line of code to get the value of the text box and store it in a variable called "age".

var age = $(".age").val();
500

Write the jQuery to change the text color of the paragraph to blue.

<p>This is not blue...yet</p>

$("p").css("color", "blue");

500

Write a click handler for a button with a class of submit

$(".submit").click(function () {
	
}
500

Write code to increase the value of the variable total by 4.

total = total + 4;

500

With the following HTML:

<input class="school">

Write a line of code to change the value of the text box to "High School".

$(".school").val("Orchard");

M
e
n
u