Question
JavaScript Question 11 (1 point) When does the ready() event handler run? Question 11 options: As soon as the browser starts. As soon as the
JavaScript
Question 11 (1 point)
When does the ready() event handler run?
Question 11 options:
As soon as the browser starts. | |
As soon as the JavaScript load event is done. | |
As soon as all the page elements are loaded in the browser. | |
As soon as the Document Object Model is built. |
Save
Question 12 (1 point)
What does the following jQuery code do? $("h2").prev();
Question 12 options:
Gets the h2 element that precedes the current element | |
Gets the element in the HTML that precedes the selected h2 element | |
Gets the previous sibling of the selected h2 element | |
Gets the previous sibling of the selected h2 element that is an h2 element |
Save
Question 13 (1 point)
What does the following jQuery code do? $("#image").attr("src", imageURL);
Question 13 options:
Gets the value of the src attribute for the element with an id of image and stores it in a variable named imageURL | |
Sets the value of the src attribute for the element with an id of image to the value in a variable named imageURL | |
Gets the values of the src attribute for each element with a class of image and stores them in an array variable named imageURL | |
Sets the values of the src attribute for each element with a class of image to the values in an array variable named imageURL |
Save
Question 14 (1 point)
Which of the following methods would you use to remove a class if its present or add a class if it isnt present?
Question 14 options:
toggle() | |
toggleClass() | |
changeClass() | |
switchClass() |
Save
Question 15 (1 point)
Which of the following methods would you use to execute a method for each element in an array?
Question 15 options:
html() | |
hide() | |
every() | |
each() |
Save
Question 16 (1 point)
Which of the following events occurs when the user moves the mouse pointer over an element and then clicks on it?
Question 16 options:
click | |
mouseover | |
hover | |
all of the above |
Save
Question 17 (1 point)
Code example 8-1 $("#faqs h2").click(function() { $(this).toggleClass("minus"); if ($(this).attr("class") != "minus") { $(this).next().hide(); } else { $(this).next().show(); } });
(Refer to code example 8-1) What does the this keyword refer to in this code?
Question 17 options:
The click() event method | |
The anonymous function for the click() event method | |
The current h2 heading in the processing loop | |
The h2 heading that was clicked |
Save
Question 18 (1 point)
Code example 8-1 $("#faqs h2").click(function() { $(this).toggleClass("minus"); if ($(this).attr("class") != "minus") { $(this).next().hide(); } else { $(this).next().show(); } });
(Refer to code example 8-1) If none of the h2 elements that use this event handler include a class attribute when the application starts, what happens the first time the user clicks on an h2 element?
Question 18 options:
A class named minus is added to the element and the elements next sibling is displayed. | |
A class named minus is added to the element and the elements next sibling is hidden. | |
Nothing happens because the click() event method is used instead of the on event method. | |
Nothing happens because the event object isnt passed to the function for the event handler. |
Save
Question 19 (1 point)
What does the evt variable refer to in this code? $("#faqs h2").click(function(evt) { evt.preventDefault(); };
Question 19 options:
the jQuery object | |
the event object | |
the this keyword | |
the selector |
Save
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started