Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me to get the answer question 1 What is true of the following code? $(h2).next().toggle(); a The next siblings of all h2 elements

Please help me to get the answer

question 1

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 5

Explain the purpose of using preventDefault() as in the code below:

$("a").click(function(evt) {

evt.preventDefault();

// ...More code

};

Your answer:

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

Question 6

Explain the purpose of so called "preloading images".

Your answer:

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

Question 7

What type of error a browser's Developer's Tools can't help you find?

a

A browser's Developer's Tools can help you find any type of errors: logical, syntax, run-time

b

syntax

c

logical

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

Question 8

jQuery code is supposed to work in _______

a

the latest version of Internet Explorer and Firefox only

b

only browsers that support it

c

Internet Explorer only

d

all the browsers

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

Question 9

Rewrite the code below using JavaScript only

paragraph1

paragraph2

paragraph3

Your answer:

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

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 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

Students also viewed these Databases questions

Question

Does it avoid use of underlining?

Answered: 1 week ago