Question: What does this keyword refer to in the code below? My Heading1 AAA My Heading2 BBB ... $(#faqs h2).click( function() { $( this ).toggleClass(minus); $(
What does this keyword refer to in the code below?
My Heading1
AAA
My Heading2
BBB
| a | The collection of all h2 headings on the page |
| b | The current h2 heading |
| c | The element with the id faqs that has an h2 heading as a descendant |
| d | The anonymous function for the click event method |
Suppose you have the following code in your JavaScript application:
var $ = function(id) {return document.getElementById(id);}
To access the paragraph TEST
| a | $("test") .... |
| b | $("p test")... |
| c | $("#test").... |
| d | $("p.test")...
|
Rewrite the code below using JavaScript only
paragraph1
paragraph2
paragraph3
Rewrite the code using % operator instead of if statement .
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 and stores it in a variable named display_error |
| d | creates a function named message |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
