Web Programming with HTML5, CSS and JavaScript

¡Supera tus tareas y exámenes ahora con Quizwiz!

Consider the following three strings: "to be or not to be", "to","tooth" Which of the following shows the strings sorted into ascending lexicographical order (words that are considered less than other words should be at the left).

"to", "to be or not to be", "tooth"

T/F. There is a parallel world between HTML element attributes and JavaScript properties, but the naming conventions are slightly different. HTML attributes use camel case, whereas JavaScript properties use all lowercase.

False

T/F. To make a border around a group of controls, surround the control elements with a legend container. To make a caption for the group, include a fieldset element within the legend container.

False

JavaScript is known as a loosely typed language. What does that mean?

It means that you do not declare a variable's data type explicitly.

What is the advantage of a list box as compared to a pull-down menu?

List boxes can be configured so they allow users to select more than one option.

When should you use dialog boxes (alert, confirm, and prompt) for input and output?

Use dialog boxes only when you want to draw sharp attention to something and you want to force the user to deal with the issue immediately.

How can you test to strings to see if they are equal?

Use the == operator

Path-absolute URLs state at the web server's root. To indicate the root, path-absolute URLs use which of the following?

/

What is the following JavaScript code an example of? var price;

A declaration statement

What goes in a navigation bar?

A group of links that enable the user to link to other pages.

To match an element by its location within a collection of elements, you can use which of the following:

A structural pseudo-class CSS rule

Which of the following statements best describe a keyword?

A word that is part of the JavaScript language

By default, there is a gap between a table's exterior border and the individual cells' borders, and there's a gap between the borders for adjacent cells. To avoid that gap, you should:

Apply a CSS rule with the border-collapse: collapse property-value pair.

Which of the following is a list of JavaScript data type? A. 22, "honey badger", true B. number, string, object, boolean C. num, name, employee, userTurn

B

Which of the following is true about preloading an audio file: A. It is helpful because by stating the download right away, you can reduce the wait time when the user clicks the play button. B. If there is limited bandwidth on the web server, and the user does not end up choosing to play the audio file, preloading will cause other downloads to slow down. C. BOTH A AND B

C. BOTH A AND B

How can you retrieve an element's object?

Call document.getElementById (element's-id-value)

T/F. A dialog box is a control that supports verbal two-way communication between the user and the computer.

False

T/F. A home page directory must be on the web server's hard drive root directory.

False

T/F. By default, table data cells (td) display their text with center alignment.

False

T/F. By default, tables created with the display property are displayed with large gaps between their cells.

False

T/F. For shortcut icons, the W3C recommends using a JPEG file.

False

T/F. If two CSS rules refer to the same property, the rule that appears first overrides the prior rule's property value.

False

T/F. If you would like a table's caption to display below the table, you should position the table's caption element at the bottom of the table container.

False

T/F. To create a group of checkboxes, you should use the same id attribute value for each checkbox in the group.

False

T/F. With the audio element, if you include the autoplay attribute, you should normally omit the controls attribute.

False

Although it is legal to use input elements without surrounding them with a form element, there are advantages using a form. Which of the following is an advantage of using a form?

Forms can lead to faster JavaScript processing of the input elements

Which of the following image file formats is the most appropriate for limited-color images such as line drawings, icons, and cartoon-like illustrations?

GIF

Which of the following is a function of the window object's location property?

Holds the URL of the current web page

To add a title to a table element, you should do which of the following?

Include a caption element within the table container

Proper coding conversations suggest that when there are JavaScript statements inside of braces({}), you should do which of the following?

Indent the statements inside the braces.

Which of the following statements is correct regarding an initialization statement?

It is a combination of a variable deceleration and an assignment.

Within an event handler function, suppose you have the following code: form.element["title"].value What does the "title" refer to?

It is the id value for a control form.

The following code generates a dialog box that contains a question and an input box: prompt ("What's your favorite color?", ""); Initially, what displays inside the input box?

Nothing (the empty string)

If an a element's target has a value of _self, that means the browser will:

Overlay the current web page with target web page

What should you do to avoid line wrap?

Press enter at an appropriate breaking point, and on the next line, indent past the starting point on the prior line.

What happens if you include a multiple attribute with a select element, but do not include a size attribute?

The browser displays a list box with a default size of 4 (four selections appear simultaneously within the list box).

Suppose birthYears is the name of a pull-down menu control. What happens when the following code executes? birthYear.selectedIndex = 0;

The browser engine selects the pull down menu's first option.

For textarea control, how do you specify the textarea control's default user input?

The browser uses the textarea tag's default attributes and displays its value.

What is the JavaScript event handler?

The code that executes when the user does something to trigger an event.

Proper coding conversation suggest using let instead of var for the for loop's index variable because

The let keyword limits the scope of the index variable for the loop.

The input element is used for different types of user input, and its type attribute specifies which of the following?

The type of user-input control that's being implemented.

Why do some users intentionally disable JavaScript on their browsers?

They are concerned that executing JavaScript code can be a security risk.

In filling a browser viewpoint's background, what is it called when multiple copies of an image are displayed?

Tiled layout

T/F The textarea control's maxlength attribute specifies the maximum number of characters the user can enter into the textarea's box.

True

T/F The video element's control attribute generates a control bar that allows the user to start the video. pause the video, and adjust the volume.

True

T/F. By default, table header cells (th) display their text with center alignment.

True

T/F. By including a background-position: center property-value pair in a CSS rule, it tells the browser to center the background image horizontally

True

T/F. By including a background-size: cover property-value pair in a CSS rule pair in a CSS rule, you are telling the browser to cover the web page's background by scaling the image.

True

T/F. For an element with a lot of text that uses absolute positioning, if you use the left property , you should also use the width property.

True

T/F. IF a user specifies a URL address that ends with a directory name, then the web server will automatically look for a file named index.html and attempt to load it into a browser.

True

T/F. If you have a table element being used for layout purposes, you should add a role="presentation" attribute to the table element's start tag.

True

T/F. In rendering a table element, the browser engine will normally determine the width of each column by using the width of that column's wildest-content cell.

True

T/F. It is legal to have more than one index.html file within a website's directory tree structure as long as the files are in separate directories.

True

T/F. With relative positioning, the left property moves an element to the right by a specified amount.

True

T/F. Within a bitmap image file, every pixel gets mapped to a particular color value, and each color value is a sequence of bits.

True

What is the purpose of adding autofocus attributes to a text control's input element?

When the web page loads, the browser puts the cursor in the text control.

To implement a video in a web page, you can use an iframe element and display a seperate web page in it, or you can use a video element to run locally stored video files. What is an advantage of using an iframe element?

You do not have to use up storage space on your own web server.

To embed a backslash character (\) within a JavaScript string, you need to use the _______ escape sequence.

\\

When implementing links on a web page, which CSS rule should you use to disable underlining for the links?

a {text-decoration:none;}

What is the syntax for generating a dialog that displays a message and does not receive input?

alert(message);

An if statement is an example of a :

branching statement

What is the syntax for generating a dialog that prompts the used to answer yes or not to a question?

confirm(message);

What is the name of the object associated with an entire web page?

document

The following code retrieves the radio button collection for a group of radio buttons where "ethnicity" is the name of the radio button group: ethnicityRBs = form.elements {"ethnicity"]; How can you retrieve the selected radio button's value?

ethnicityRBs.value

If you move your mouse over an image map and click on a(n) _________, you jump to another web page or another place within the current web page.

hotspot

Suppose you have a collection of checkboxes named skills. To access an individual checkbox within the collection, you can use skilled[i]. The i is referred to as a(n) _________ variable.

index

If you include the _________ attribute with a select element, the user will be able to select multiple options.

multiple

An a element's href attribute specifies a resource that is to be linked to. It the href attribute uses a relative URL, that means the browser will look for the resource:

on the current web server, but on a web page different from the current web page.

Which event handler attribute detects whether the value of a form control has changed?

onchange

Which of the following should you include within a tbody container?

one or more tr elements

For the textarea control, the ________ attribute specifies that the textarea control's height, which is the number of lines of text in the box that can be viewed simultaneously.

rows

If a pull-down menu's option element has a(n) _________ attribute, the option's value is preselected within the pull-down menu.

selected

If you want an element to be interpreted as a table caption, you should apply a CSS rule with a display property. Which value should you use for the display property?

table-caption

To implement an element within a table row that holds data, use the __________ element.

td

If you are inside a form control, to retrieve the form element's object, you should use:

this.form.

To create gaps between the table's cells in tables created with the display property, you should apply the border-spacing property to:

to table element

To implement a row within a table container, use the ______ element.

tr

By default, browsers use blue to display links that have not been clicked. They are formally known as _____ links.

unvisted

How would you display an SVG file's image within a web page?

use the img element with a src attribute.

To turn on absolute positioning, you should apply a CSS rule to the container in which absolute positioning is to take place. In the CSS rule, you should:

use the position: absolute property-value pair

For a CSS dimension property (like height), you can use 100vh to indicate 100 percent of the viewport's height. The vh units stands for __________.

veiwport height

To align the text within a table's data cells so the text is vertically centered, you should use:

vertical-align: middle within a td type selector rule

When executed, what does the following code fragment display? var x = 5; var y = x++; alert ("x = " + x + ", y = " + y) ;

x = 6, y= 5

Given the following valid for....of loop heading, what do x and y represent? for (let x of y) {

y is the collection, and x is an element in that collection.

Which of the following is valid code for a shortcut icon?

<link rel="icon" href="../images/jsd.gif">

Suppose a variable x holds "dog". After the following code gets executed what does the x hold? x += "fish";

"dogfish"

The *:not (a) pseudo-class selector selects which of the following?

All elements except for a elements (links)

Coding conventions suggest using camel case for JavaScript identifiers. That is camel case?

All letters should be lowercase except for the first letter in the second word, third word, and so on.

T/F. Applying the display: flex property-value pair to a container causes the container to expand beyond the browser window's borders.

False

T/F. For audio files to work with HTML5, end users are required to install a browser audio plug-in.

False

T/F. If you omit the width and height attributes, the browser will use default values for these attributes.

False

T/F. In a pull-down menu, if no option element has a selected attribute, then the pull-down menu displays "invalid" by default.

False

T/F. In executing a while loop, the JavaScript engine first executes the while loop's body and then checks the while loop's condition.

False

T/F. The JavaScript language is basically the same as the Java Language, except that JavaScript can be run on the Web and Java cannot be run on the Web.

False

T/F. The default type of control for the input element is a button control.

False

T/F. The following code would be a legal code in JavaScript identifier: 100Transactions

False

Which of the following is one of the primary advantages of vector graphics images over bitmap images?

If you resize a vector graphic image, no degradation occurs

After the following code executes, what does x hold? var location = "Taos, NM" var x = location. charAT (location.length - 1);

M

When the following code executes, what message does the dialog box display? var month = " January"; if (month.toLowerCase () == "january") { alert ("It is " + month + "!") }

Nothing (the empty string)

IF the pull-down menu's select element has a required attribute, it means that when the pull-down menu's form is submitted.

The pull-down menu control is considered to be invalid if the used selected value is the

T/F. A CSS image sprite is when you have a file with multiple images in it, and the browser animates the image so the user views only one image at a time.

True

T/F. A block statement (zero or more statements surrounded by braces) can be used anywhere a standard element can be used.

True

T/F. A color gradient value display's a smooth transition between two or more colors.

True

T/F. A global value is a variable this is shared among all the functions for particular web page.

True

T/F. Ecma international is the standards organization in charge of maintaining the ECMAScript standard.

True

T/F. Every web page element object has a style property, and that style property is an object that has properties for the web page element object's CSS.

True

T/F. For the "if, else if, else" form of the if statement, if a condition is found to be true, that condition's block statement is executed. Then, all the other conditions are skipped, and control flows down to the statement below the entire if statement.

True

T/F. IF a web page contains an element with an id attribute, the id attribute's value must be unique for all elements on the web page.

True

T/F. Inline JavaScript is when an event handler attribute is assigned JavaScript code that does the work there, rather than in a called a function.

True

T/F. Line wrap is when text at the end of a long a line wraps to the next line, where it displays without any indentations.

True

T/F. Local variables persist only for as long as the JavaScript engine is executing code within variable's function.

True

T/F. The following code would be legal JavaScript identifier: dataFor2Records

True

T/F. The img element is an inline element (more formally, a phrasing element), so it gets displayed with in the normal flow of its surrounding text.

True

T/F. The number of times that a loop repeats is referred to as the number of loop iterations.

True

T/F. The outerHTML property includes the element's start and end tags, whereas the innerHTML property does not.

True

T/F. The output element is for holding the results of a user's action.

True

T/F. The text control's placeholder attribute provides a word of a short description that helps user to know what to enter into the text control.

True

T/F. The window object is known as the global object because all of its members are global.

True

T/F. The window object's screen property holds information about the monitor that is being used.

True

T/F. The z-index CSS property determines the order of overlapping elements along the web page's z axis.

True

T/F. To associate an img element with a map element, the img element must include a usemap attribute with the map element's id value for the usemap attribute.

True

T/F. To process user's selections from a list box, use the select element object selectedOptions property to access the selected options and loop through those selected options.

True

In implementing a CSS image sprite file, the image comes from:

a CSS rule with a background-image-url (filename) property-value pair.

If an a element's target attribute has a value of _blank, that means the browser will:

open the target web page in a new browser window or in a new tab within the current browser window.

For the audio element, which property-value pair provides a suggestion to download the audio file when the page loads initially?

preload="auto"

For the audio element, which property-value pair provides a suggestion to download no information about the audio file when the page loads initially?

preload="none"

In organizing a website's links, a linear structure is good for:

presenting a long article


Conjuntos de estudio relacionados

MIS 3330 (Java Programming) Exam 2 CH: 6-9

View Set

Med-Surge Nursing Cardio Prep U ch 25

View Set

II.1/II.2 Use semicolons and commas to separate clauses

View Set