True or False, the same symbol in JS is used to add numbers and strings.
T
To output information to a pop-up box you use the command
alert()
True or False, you can start a line of jQuery with $ or jQuery
T
True or False, the first object in an array is position 1
F
True or False, the letter "m" in sample is at character position 3 of the string.
F
In JS: To set the font color to red of an object IDed as name you would type.
document.querySelector("#name").style.color = 'red'
To output information to the javascript/error console you use the command
console.log()
Write the jQuery code that would fade out the element IDed as box1 over 3 seconds.
$("#box1").fadeOut(3000)
To add a new value "blue" to the colors array you would type.
colors.push("blue")
The ______ command extracts part of a string, and takes ____ inputs.
substring() and 2
To call the function checkage with the contents of the #age textbox, you would type
checkage(document.querySelector("#age").value)
True or False, Javascript is one of the most popular frameworks or libraries on the Web.
F
Write the jQuery that would set up a click trigger on the object IDed as button1, that would animate a slide down on the object IDed as infobox.
$("#button1").on("click", function(){
$("#infobox").slideDown()
}
To output to the document the value of the fifth item in the photourl array you would type...
document.write(photurl[4])
The _____ command tries to find a string within a string.
indexOf()
if(age>=18) {
alert('You can vote!')
}
Write the Javascript that would create a new function named setcolor, which takes one input variable named newcolor, and sets the background color of the page to that color when it is called.
var setcolor = function(newcolor){ document.querySelector("body").style.backgroundColor = newcolor
}