Fix it! This should be an anchor tag with an id of clickme, that links to https://scripted.org/:
ScriptEd
<a href="https://scripted.org/" id="clickme">ScriptEd</a>
jQuery is a _______ of Javascript.
What is a library?
What is the data type of: 132?
Number (Integer)
The name of this function:
function addToJeopardyScore(points) {...}
addToJeopardyScore
True or false? All of the following data types can be included in an array: string, boolean, number.
True
Write it! Using correct indentation, create a container with the class of "container". In this container create an unordered list of ice cream flavors: vanilla, chocolate, and strawberry.
The answer's indentation may not be displayed correctly due to the Jeopardy platform.
<div class="container">
<ul>
<li>vanilla</li>
<li>chocolate</li>
<li>strawberry</li>
</ul>
</div>
The following line of code does this: $(".intro").
What is select all elements with the class intro?
What is the value of z?
var x=5;
var y=7;
var z =x+y;
x=10;
z=12;
The arguments used when calling this function:
add(5, 7);
5, 7
This is how you would access the 2nd element of an array with the name of arr.
arr[1]
Write it! Use CSS to change this element's text to brown.
<p id="sentence">The quick brown fox</p>
#sentence {
color: brown;
}
Write it! Write the jQuery code to change all elements of class "red" to have the background color of red.
$(".red").css("background-color", "red");
The code below should print a random number to the console when a button is clicked. Find the error.
$("button").click(function(){
var randomNum = math.random();
console.log(randomNum);
});
$("button").click(function(){
var randomNum = Math.random();
console.log(randomNum);
});
What will this function return, assuming that it adds the two arguments together?
add(add(12, 4), 5);
21
Find the error in the following code.
var alph=["a","b","c"];
alph.forEach(letter){
console.log(letter);
});
var alph=["a","b","c"];
alph.forEach(function (letter){
console.log(letter);
});
Write it! Give the following div a solid, red, 5-pixel border
<div class="danger">Caution</div>
.danger{
border:5px solid red;
}
Based on the code:
$("#run").click(function(){
$("#emoji").hide();
});
What will happen when the any element with the id "#run" is clicked. (Be Specific)
The elements with the id of emoji will be hidden.
You'd like to print a new random number to the console every time a button is clicked. Find the error in the code.
var random = Math.random();
$("button").click(function(){
console.log(random);
});
$("button").click(function(){
var random=Math.random();
console.log(random);
});
Find the error.
var x=7;
if(x=5){
console.log(true);
}else if(x>5){
console.log(false);
}else{
console.log(false);
}
var x=7;
if(x===5){
console.log(true);
}else if(x>5){
console.log(false);
}else{
console.log(false);
}
How would you change the following code so the greeting "Hi, " is added before each array element?
var names = ["Michael","Peter","Naomi"];
names.forEach(function(name){
console.log(name);
});
var names = ["Michael","Peter","Naomi"];
names.forEach(function(name){
console.log("Hi, "+ name);
});
This question's indentation may not be displayed correctly due to the Jeopardy platform.
Write it! Apply flexbox to the navbar.
<div id="nav">
<div>Home</div>
<div>About</div>
<div>More</div>
</div>
#nav{
display:flex;
}
Write it! Write the code that would retrieve the value of something typed in an input box with the id of username when a button with an id of "submit" is clicked.
$("#submit").click(function(){
$("#username").val();
});
Write it! Write the code that will print a random number between 0 and 3 to the console when a button is clicked.
$("button").click(function(){
var random=Math.random();
console.log(random*3);
});
Write it! Write a conditional statement that alerts "Success!" if someones types "password" in an input box.
var userInput = $("input").val();
if(userInput==="password"){
alert("Success!");
}
Write it! Write the code that will loop through the following array and print each element.
var flavors= ["chocolate","vanilla","strawberry"];
var flavors= ["chocolate","vanilla","strawberry"];
flavors.forEach(function(flavor){
console.log(flavor);
});