Increasing the value of the length property adds more items to an array, but the items have null values until they are defined.
Answer
True
False
True
Increasing the value of the length property adds more items to an array, but the items have null values until they are defined.
A variable requires an initial value to be defined.
Answer
True
False
False
You do not have to provide an initial value to a variable. You can leave the variable's value undefined.
A transition must start immediately after an event that triggers it.
Answer
True
False
False
A transition does not need to start immediately after the event that triggers it.
For url type data, the virtual keyboard includes a key that inserts the .com character string.
Answer
True
False
False
For url data, the virtual keyboard includes a key that inserts the www. character string.
A web table can contain any number of thead and tfoot elements but only one tbody element.
Answer
True
False
False
A table can contain only one thead element and one tfoot element, but it can include any number of tbody elements to mark row groups that contain several topical sections.
When each entry in an array matches the entry in another array, it is called a linear array.
Answer
True
False
False
The following array stores the number of days in each month: var dayCount = [31,28,31,30,31,30,31,31,30,31,30,31];. This array is an example of a parallel array because each entry in the array matches—or is parallel to—an entry in the monthName array created in the first session of Tutorial 10.
Parameters are treated as variables within a function.
Answer
True
False
True
Parameters are treated as variables within the function.
The src, type, height, and width attributes can be applied to the embed element for any plug-in.
Answer
True
False
True
The src, type, height, and width attributes are generic attributes and can be applied to the embed element for any plug-in.
The placeholder automatically disappears as soon as a user selects the control and begins to enter a value.
Answer
True
False
True
Placeholders are text strings that appear within a form control, providing a hint about the kind of data that should be entered into the field. The placeholder automatically disappears as soon as a user selects the control and begins to enter a value.
The th element is used to mark the data cells.
Answer
True
False
False
Web tables support two types of table cells: header cells that contain content usually placed at the top of a column or the beginning of a row and data cells that contain content within those columns and rows. A header cell is marked using the th element.
What is the output of the following code?
for(var i = 5; i > 0; i--)
Answer
i = 4, 3, 2, 1, 0
i = 5, 4, 3, 2, 1
i = 0, 1, 2, 3, 4
i = 1, 2, 3, 4, 5
i = 5, 4, 3, 2, 1
The general structure of a for loop is for (start; continue; update) {commands} where start is an expression that sets the initial value of a counter variable, continue is a Boolean expression that must be true for the loop to continue, update is an expression that indicates how the value of the counter variable should change each time through the loop, and commands are the JavaScript statements that are run for each loop. Thus, the counter values of the for loop for (var i = 5; i > 0; i--) are i = 5, 4, 3, 2, 1.
_____ is the process of locating and fixing a programming error.
Answer
Scripting
Buffering
Debugging
Booting
Debugging
Debugging is the process of locating and fixing a programming error.
Which of the following languages is used to set the width of a media player, add borders and drop shadows, and apply filters and transformations to the media player's appearance?
Answer
Ruby
CSS
PHP
Perl
CSS
You can use CSS to set the width of the media player, add borders and drop shadows, and apply filters and transformations to the player's appearance but, if you want a completely customized player, you need to build it yourself using form controls.
The technique of immediate data validation and reporting of errors is known as _____.
Answer
server-side validation
inline validation
online validation
client-side validation
inline validation
The technique of immediate data validation and reporting of errors is known as inline validation.
Which of the following is an equivalent HTML element for the display style display: table-cell;?
Answer
<th>
<table>
<col>
<tr>
<th>
FeedbackEdit Feedback Answer 1 of 4 feedback
Using the CSS display property, you can apply a table layout to other HTML elements, such as paragraphs, block quotes, or lists. The display style display: table-cell; is equivalent to the HTML element td or th.
JavaScript allows for the creation of _________, in which some array values are undefined.
sparse arrays
Document objects are organized in a hierarchical structure called the _________.
Document object model (DOM), DOM
The _________ element, which replaced the embed element, is used for any type of content such as sound, video clips, graphic images, PDF files, and even the content of other web pages.
object
By default, a _________ appears as a drop-down list box.
selection list
In HTML, to specify the caption location for a web table the _________ property is used.
caption-side
Describe the structure of the if else statement.
The if statement runs a command or a command block only if the conditional expression returns the value true; it does nothing if the condition is false. On some occasions, a user might want to choose between alternate command blocks so that one command block is run if the conditional expression is true, and a different command block is run if the expression is false. The general structure of an if else statement follows:
if (condition) {
commands if condition is true
} else {
commands if condition is false
}
If only a single command is run in response to the if statement, one can use the following abbreviated form:
if (condition) command if condition is true
else command if condition is false;
The following example shows an if else statement that displays two possible alert boxes depending on whether the value of the day variable is Friday or not:
if (day === "Friday") alert("Thank goodness it's Friday")
else alert("Today is " + day);
Like if statements, if else statements can be nested as in the following code, which chooses among three possible alert boxes:
if (day === "Friday") alert("Thank goodness it's Friday")
else {
if (day === "Monday") alert("Blue Monday")
else alert("Today is " + day);
}
Some programmers advocate always using curly braces even if the command block contains only a single command. This practice visually separates one else clause from another. Also, when reading through nested statements, it can be helpful to remember that an else clause usually pairs with the nearest preceding if statement.
Explain briefly how to convert between numbers and text.
Sometimes, it is necessary to convert a number to a text string and vice versa. One way to convert a number to a text string is by using the + operator to add a text string to a number. For example, the following code uses the + operator to concatenate
a numeric value with an empty text string. The result is a text string containing the characters 123.
testNumber = 123; // numeric value
testString = testNumber + ""; // text string
To convert a text string to a number, one can apply an arithmetic operator (other than the + operator) to the text string. The following code takes the text string 123 and multiplies it by 1. JavaScript converts the text string "123" to the numeric value 123.
testString = "123"; // text string
testNumber = testString*1; // numeric value
Another way of converting a text string to a numeric value is to use the following parseInt() function, which extracts the leading integer value from a text string:
parseInt(text)
where text is the text string or variable from which the user wants to extract the leading integer value. The parseInt() function returns the integer value from the text string, discarding any non-integer characters. If a text string does not begin with an integer, the function returns the value NaN, indicating that the text string contains no accessible number. The following are some sample values returned by the parseInt() method:
parseInt("120 lbs"); // returns 120
parseInt("120.88 lbs"); // returns 120
parseInt("weight equals 120 lbs"); // returns NaN
Briefly describe the styles applied to track cues.
CSS supports the following cue pseudo-element to format the appearance of the cues appearing within a media clip:
::cue {
styles
}
The styles for the cue pseudo-element are limited to the background, color, font, opacity, outline, text-decoration, text-shadow, visibility, and white-space properties. For example, the following style rule displays all cues in a 2em yellow serif font on a red background:
::cue {
background: red;
color: yellow;
font: 2em serif;
}
The cue pseudo-element selects all of the cue text in the media clip. To format specific cues or text strings within a cue, a user can identify the sections of the cue text using the following markup tags:
• <i></i> for italicized text
• <b></b> for bold-faced text
• <u></u> for underlined text
• <span></span> to mark spans of text
• <ruby></ruby> to mark ruby text
• <rt></rt> to mark ruby text
WebVTT also supports tags that are not part of the HTML library, such as the following <c></c> tag used to mark text strings belonging to a particular class:
<c.classname></c>
Here, classname defines the class.
And for captions that distinguish one voice from another, WebVTT supports the following <v></v> tag:
<v name></v>
Here, name is the name of the voice associated with the caption.
For cues based on their class name, add the class name to the cue pseudo-element as follows:
::cue(.classname) {
style rules
}
Here, classname is the class marked within in the <c></c> tag.
To format voice text, use the style rule as follows:
::cue(v[voice=name]) {
style rules
}
Here, name is the name assigned in the <v></v> tag.
What are the pseudo-classes for valid and invalid data?
The valid and invalid pseudo-classes are used to format controls based on whether their field values pass a validation test or not. For example, the following style rule displays all the input elements containing invalid data with a light red background:
input: invalid {
background-color: rgb (255, 232, 233);
}
On the other hand, the following style rule displays all the input elements containing valid data with a light green background:
input: valid {
background-color: rgb (220, 255, 220);
}
Both of these style rules set the background color whether the input element has the focus or not. Displaying a form full of input backgrounds with different background colors can be confusing and distracting to the user. As a result, it is better practice to highlight invalid field values only when those input controls have the focus, as shown in the following style rule that combines both the focus and invalid pseudo-classes:
input:focus:invalid {
background-color: rgb (255, 232, 233);
}
What are the CSS properties that are used to manage column breaks?
The placement of column breaks can be controlled through several CSS properties.
The size of column orphans (a line of text stranded at the bottom of a column) can be controlled using the following orphansproperty:
orphans: value;
where value is the minimum number of lines stranded before a column break. Similarly, to control the size of column widows (a line of text placed at the top of a column), the following widows property is used:
widows: value;
where value is the minimum number of lines placed after the column break.
Another way to define a column break is to use the properties
break-before: type;
break-after: type;
where type can be either auto (to allow the browser to automatically set the column break), always (to always place a break), or avoid (to avoid placing a column break).