HTML DOM Flashcards

1
Q

Consider the following code snippet:


What does the min means?

Select one:
a. Minimized version
b. Miniature
c. Minimized parameter
d. Minimum value

A

a. Minimized version

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following are the different ways of invoking jQuery() function.

i) invoke $() is to pass a CSS selector to it
ii) invoke $() is to pass an element or document or window object
iii) invoke $() is to pass a string of JavaScript code
Select one:
a. i, ii only
b. i, ii and iii
c. None of these

A

a. i, ii only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Here is a jquery code:

$(document).ready(function(){});

Why do we place all jQuery methods inside this code?

Select one:
a. Because jQuery is never compiled
b. It shows where jQuery starts and ends
c. To enable the DOM to load jQuery
d. To prevent jQuery code from running before the document is fully loaded

A

d. To prevent jQuery code from running before the document is fully loaded

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

jQuery uses CSS selectors to select elements?
Select one:
a. True
b. False

A

a. True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Look at the following selector: $(“div”). What does it select?
Select one:
a. The first div elements
b. All div elements

A

b. All div elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Look at the following selector: $(“p#intro”). What does it selct?
Select one:
a. The p element with id = “intro”
b. All the p elements with class = “intro”

A

a. The p element with id = “intro”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Triggers or binds a function to the error events of the selected elements.
Select one:
a. click()
b. error()
c. evnet.pageX
d. click.error()

A

b. error()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the correct jQuery code to set the background color of all p elements to red?
Select one:
a. $(“p”).style(“background-color”, “red”);
b. $(“p”).layout(“background-color”, “red”);
c. $(“p”).css(“background-color”, “red”);
d. $(“p”).manipulate(“background-color”, “red”);

A

c. $(“p”).css(“background-color”, “red”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What scripting language is jquery written in?
Select one:
a. VBScript
b. JavaScript
c. C#
d. C++

A

b. JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When do you use the $(this) code?
Select one:
a. When an HTML element will reference its own action.
b. When an HTML element will reference its parent element’s action
c. When an HTML element will reference the entire document
d. None of the above.

A

a. When an HTML element will reference its own action.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which built-in method returns the character at the specified index?
Select one:
a. characterAt()
b. getCharAt()
c. charAt()
d. None of the above

A

c. charAt()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which jQuery function is used to prevent code from running, before the document is finished loading?
Select one:
a. $(body).onload()
b. $(document).load()
c. $(document).ready()

A

c. $(document).ready()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which jQuery method is used to hide selected elements?
Select one:
a. display(none)
b. hidden()
c. visible(false)
d. hide()

A

d. hide()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which jQuery method is used to set one or more style properties for selected elements?
Select one:
a. html()
b. css()
c. style()

A

b. css()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following are the features of jQuery?
Select one:
a. Efficient query method for finding the set of document elements
b. Expressive syntax for referring to elements in the document
c. Useful set of methods for manipulating selected elements
d. All of the mentioned

A

d. All of the mentioned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

With jQuery, look at the following selector : $(“div.intro”). What does it select?
Select one:
a. The first div element with class = “intro”
b. All the div elements with id = “intro”
c. All the div elements with class = “intro”
d. The first div element with id = “intro”

A

c. All the div elements with class = “intro”