Quiz 5 Flashcards

1
Q
Case-Based Critical Thinking Questions
​
Case 12-1
​
Consider the following code that Wilson has written in HTML:
< html >
< head >
< title >Historic Documents
< /head >
< body >
< h1 >Dept. of History< /h1 >
< p >The <b>constitution</b> online.< /p >
< /body >
< /html >
Identify the headLevel value for the element node “Dept. of History".

a) 1
b) 3
c) 0
d) 2

A

c) 0

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

Simon uses the function.apply(thisObj[,argArray] method to call a method from another object class. In this method, argArray is a(n) _____.

a) object calling the arguments of an array
b) argument consisting of arrays
c) array of argument values
d) method of argument values

A

c) array of argument values

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

Identify a true statement about the sheet. parentStyleSheet property .

a) It describes the URL of the style sheet file or an empty text string for an embedded style sheet.
b) It describes a Boolean value to indicate whether the style sheet is enabled (false) or disabled (true).
c) It describes the object collection of style rules within the style sheet.
d) It describes the style sheet object containing the style sheet inserted via the @ import rule.

A

d) It describes the style sheet object containing the style sheet inserted via the @ import rule.

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

To create a negative character class that matches any character not in the class, preface the list of characters with the _____ symbol.

a) &
b) #
c) ^
d) *

A

c) ^

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

T/F Each parent node can contain only one child node.

A

F

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

T/F To determine which option button has been checked by the user, you must examine the disabled property of each button.

A

F

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

Identify the input field property or method that can be used to remove the focus from the input box.

a) input.pattern
b) input.required
c) input.focus()
d) input.blur()

A

d) input.blur()

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

In many web forms, important data is stored within _____ so that the data is available to programmers but removed from the user’s control.

a) hidden fields
b) reference forms
c) event handlers
d) radio buttons

A

a) hidden fields

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

The _____ property describes the embed or link element node that creates a style sheet.

a) sheet.rootnode
b) sheet.attributenode
c) sheet.ownerNode
d) sheet.elementnode

A

c) sheet.ownerNode

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

Case based critical thinking

Case 13-4

Samantha is working on a web document. She wants to direct the browser to retrieve specific information about a URL, to reload the current page, and to load an entirely new page.

Which of the following commands can Samantha use to load a new page in the current window?

a) location.url = window
b) window.url = location
c) window.location = url
d) url.window = location

A

c) window.location = url

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

Case based critical thinking

Case 13-1

Sarah wants to set the value of an input control. She applies the element.value = value; expression.
Which of the following methods should Sarah use to return the default value for the input box?

a) input.select()
b) input.focus()
c) input.defaultValue
d) input.value

A

c) input.defaultValue

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

The _____ method discards the old node from node.

a) node. removeChild(old)
b) node .appendChild(old)
c) node. normalize(old)
d) node. replaceChild(new, old)

A

a) node. removeChild(old)

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

Identify the syntax that determines how a new item is inserted into a nested list.

a) if ( headLevel !=== prevLevel ) {
// Append the list item to the current list

} else if ( headLevel < prevLevel ) {

// Start a new nested list

} else {

// Append the entry to a higher list

}
b)  if ( headLevel > prevLevel ) {
// Append the list item to the current list

} else if ( headLevel === prevLevel ) {

// Start a new nested list

} else {

// Append the entry to a higher list

}
c)   if ( headLevel === prevLevel ) {
// Append the list item to the current list

} else if ( headLevel > prevLevel ) {

// Start a new nested list

} else {

// Append the entry to a higher list

}
d)   if ( headLevel > prevLevel ) {
// Append the list item to the current list

} else if ( headLevel < prevLevel ) {

// Start a new nested list

} else {

// Append the entry to a higher list

}

A
c)   if ( headLevel === prevLevel ) {
// Append the list item to the current list

} else if ( headLevel > prevLevel ) {

// Start a new nested list

} else {

// Append the entry to a higher list

}

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

t/f The select.name method returns the selection list field name.

A

t

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

t/f One object can be nested within another.

A

t

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

Identify the correct syntax to add methods to a custom object.

a) var objName = {
function: method () {

commands

}

}

b) Commands = {
method: function() {

var objName

}

}

c) var objName = {
method: function() {

commands

}

}
d)   var objName = {
function() {

method()

}

}

A

c) var objName = {
method: function() {

commands

}

}

17
Q

For options buttons and check boxes, use the _____ event handler in response to the user clicking those elements.

a) onselect
b) onreset
c) oninput
d) onclick

A

d) onclick

18
Q

Which of the following commands is used to create a custom object using the new operator?

a) var objName = new Object();
object. property = value;

object.method = function() {

commands

};

b) var objName = value;
object. Name = value;

object.property = function() {

commands

};

c) var method = new Object();
object. property = value;

object.objName = function() {

commands

};

d) var objName = Object();
object. Name = Object();

object.method = function() {

commands

};

A

a) var objName = new Object();
object. property = value;

object.method = function() {

commands

};

19
Q

The _____ option from the toLocaleString() method indicates whether to use a thousands grouping symbol (true) or not (false) .

a) useGroup: Boolean
b) style: type
c) maximumSignificantDigits: num
d) minimumSignficantDigits: num

A

a) useGroup: Boolean

20
Q

t/f The value associated with a checked box is stored in the name property of the check box object.

A

f

21
Q

Which of the following methods is applied to sort any array in random order?

a) object create() method
b) console.log() method
c) shuffle() method
d) sort() method

A

c) shuffle() method

22
Q

Which of the following properties returns the Boolean value true when an element contains an attribute?
node .setAttribute

a) node .setAttribute
b) node.Attribute
c) node .hasAttribute
d) node .getAttribute

A

c) node .hasAttribute

23
Q

Identify the name:value pair that includes a function name and its commands, which is used to add methods to a custom object.

a) var objName = {
method: function() {

commands

}

}
b) var obj= {
function() {

commands

}

}

c) var objName = {
command. function() {

method()

}

}

d) var objName = {
function: method() {

commands

}

}

A

a) var objName = {
method: function() {

commands

}

}

24
Q

t/f Using prototypes, any object class inherits the properties and methods from another class.

A

t

25
Q

t/f The showName() method provides another way to create objects that are based on existing prototypes.

A

f