Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1 What is true of the following code? $(h2).next().toggle(); a The next siblings of all h2 elements will become hidden or shown with the alternate

Q1

What is true of the following code?

$("h2").next().toggle();

a

The next siblings of all h2 elements will become hidden or shown with the alternate clicks.

b

The h2 heading, which is right after the last h2 element on the page, will become hidden or shown with the alternate clicks.

c

The statement is incorrect because you cannot use two methods , one after another.

d

All h2 elements and the next siblings right after them will will become hidden or shown with the alternate clicks.

---------------------------------------------------

Question 2

When will the function shipCost() be executed for the first time?

window.onload = function() {

$("ship").onclick = shipCost();

};

a

When the user clicks on it.

b

It will never be executed because the code is not correct

c

When the page loads

d

When the user clicks or double clicks on it.

------------------------------------------------------

Question 3

To include the jQuery library in a web page, you _____________. (Check all that applies)

a

don't have to reference it as all modern browsers can recognize a jQuery code

b

can download the jQuery library and reference it with the HTML

paragraph1

paragraph2

paragraph3

Your answer:

------------------------------------------------

Question 10

jQuery is ________

a

a programming language similar to JavaScript

b

a JavaScript library

c

an extension of the Chrome browser

d

all of the above

------------------------------------------------

Question 11

Which method of the Document interface retrieves an array of all the h1 headings?

a

getElementsByName("header")

b

getElementsByTagName("h1")

c

getElementsByTagName(h1)

d

getElementsById("h1-heading")

----------------------------------------------------

Question 12

Rewrite the code using % operator instead of if statement .

        

Your answer:

----------------------------------------------

Question 13

Change the code below so it does the following :

The text should change from "no mouse" to "mouse is here" when mouse enters the paragraph and return the text back to "no mouse" when mouse leaves.

       

no mouse

no mouse

no mouse

Your answer:

-------------------------------------

Question 14

What is the difference between setTimeout and setInterval methods ?

Your answer:

---------------------------------------------

Question 15

The following code:

var message = function(display_error) {

alert("Error: " + display_error);

}

a

creates a function named display_error

b

creates a function and stores it in a variable named message

c

creates a function named message

d

creates a function and stores it in a variable named display_error

-------------------------------------------------------------

Question 16

What does this keyword refer to in the code below?

My Heading1

AAA

My Heading2

BBB

a

The element with the id faqs that has an h2 heading as a descendant

b

The anonymous function for the click event method

c

The collection of all h2 headings on the page

d

The current h2 heading

-------------------------------------------------------------------

Question 17

Suppose you have the following code in your JavaScript application:

var $ = function(id) {return document.getElementById(id);}

To access the paragraph

TEST

you would use the following JavaScript code:

a

$("#test")....

b

$("p.test")...

c

$("test") ....

d

$("p test")...

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions