stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Iterating with JQuery: Lesson 6.2 CodeHS Flashcards | StudBud
Explore
/
Iterating with JQuery: Lesson 6.2 CodeHS
Iterating with JQuery: Lesson 6.2 CodeHS
9 terms
·
StudBud Administration
·
22 plays
Made for Honors Web Development.
Flashcards
9 cards
F
Practice quiz
P
Host live
L
Questions
9
Answers
1
True or False: .each is best used when attempting to style all elements of a given type.
True
False
2
Which of the following is closest to .each?
while(){}
for(var i = 1; i <= $("tr").length; i++){}
document.getElementById
document.getElementByClassName
3
6.1 Review: How can we add the jQuery library to our web pages?
Add a script to the body that includes a link to the jQuery source.
Add the $() selector tag to your scripts.
Paste the jQuery page source directly into the webpage body.
Add a script to the head that includes a link to the JQuery source.
4
Which of the following is NOT a correct way to call the .each function?
$(element).each(function(el, i){ //some code});
$(element).each(function(i, el){ //some code});
$(element).each(function(){ //some code});
$(element).each(function(this){ //some code});
5
6.1 Review: What is the correct selector in jQuery if a user wanted to change the style of all items of class newColor?
$("#newColor")
$(newColor)
$("newColor")
$(".newColor")
6
What is .each?
A function that iterates through a list of selected elements
A function used to randomly shuffle the order of elements in an array.
A function used to convert a string into an array of individual characters.
A function that randomly selects values.
7
6.1 Review: What is jQuery?
A JS library used w/ Javascript to make DOM selecting & manipulation easier
A better version of JS that replaces old JS code to make coding easier
An API that gives documentation of all Javascript functions.
A programming language used in HTML to select and manipulate elements.
8
What will print as a result of this jQuery script? Assume that element is valid and 5 instances of it on the webpage
[element Obj][element Obj][element Obj][element Obj][element Obj]
Nothing will be printed to the console.
1 2 3 4 5
0 1 2 3 4
9
The function in .each can also include two parameter types
True
False