HTML Tutorial 9
Identify the output of the following code. var x = 8; var y = 6;
56 28 96
_____ is the programming language for client-side programs.
JavaScript
The _____ attribute tells a browser to parse the HTML and JavaScript code together, only pausing to process the script before returning to the HTML file.
async
Identify a command that displays a dialog box containing the message "Hello World!".
window.alert("Hello World!");
Which of the following methods of the Math operator rounds x up to the next highest integer?
Math.ceil(x)
The _____ property should be used only when no markup tags are involved.
textContent
Identify a command that uses the dateDiv variable to refer the page element with ID dateNow.
var dateDiv = document.getElementById("dateNow");
To break a text string into several lines, which means that the text string continues on the next line, the _____ character should be used.
backslash
The technique for locating the source of an error is to set up _____, which are locations where the browser will pause the program, allowing the programmer to determine the error at that position.
breakpoints
JavaScript is used as a programming tool for:
creating interactive web forms and animated graphics
The _____ attribute can be applied to the script element to ensure that an object can be referenced within a JavaScript program that runs only after the page has completed loading.
defer
Identify an expression that can be used to refer an element by its id attribute.
document.getElementById(id)
A(n) _____ is a collection of commands that performs an action or returns a value.
function entity pointer
Which of the following syntax is used for a function to return a value?
function function_name(parameters){ commands return value;}
Identify a syntax for JavaScript function.
function_name function(parameters){ commands }
Identify a syntax to access any of the mathematical constants supported by the Math object.
math.constant Math.CONSTANT Math.constant
Identify an expression that defines a date object.
new Date("month day, year" "hrs:mins:secs"); new Date("month day, year hrs:mins:secs"); new Date("month, day, year" hrs:mins:secs);
A video embedded on a web page is a(n) _____ and has properties such as source of the video file or the width and height of the video player.
object
Objects are organized into groups called _____.
object collections
Identify an expression used to apply a method to an object.
object.object(method) object.method(values) Object.name(values)
A _____ occurs after a script has been successfully loaded with no syntax errors and is being executed by a browser.
run-time error
JavaScript code is attached to an HTML file using the _____ element.
script
A command that indicates an action for the browser to take should end with a _____.
semicolon
Identify a method that repeatedly runs commands at specified time breaks in a function created.
setInterval("command", interval)
Identify a syntax to set the time-delayed commands.
setTimeout("command", delay);
A user can create an embedded script by removing the _____ attribute and placing all of the JavaScript code within the script element.
src
Developers advocate that JavaScript be run in _____ in which all lapses in syntax result in load-time or run-time errors.
strict mode
A(n) _____ is any group of characters enclosed within either double or single quotation marks in JavaScript.
text string
Identify a property used to refer an HTML code that is stored within a page element.
element.innerHTML
Identify a function that extracts the first numeric value from the text string.
parseFloat(string)
Identify a statement that is added to the first line of the file to run a script in strict mode.
"use strict";
_____ are intrinsic to the JavaScript language.
Built-in objects
_____ is the process of locating and fixing a programming error.
Debugging
Identify a shortcut key on the keyboard to open the debugging tools.
F12
Identify a return value for the expression 5/"A" using JavaScript.
NaN
A(n) _____ is a named item in a program that stores a data value, such as a number or text string, or an object, such as a part of the web browser or browser window.
variable
To avoid fatal errors, it is advised to apply the _____ statement locally only to functions that are created rather than globally as the first line of the script file.
"use strict"; "use global"; "use moderate";
Which of the following can be referenced only after the browser has finished parsing the page content?
Built-in objects Browser objects Document objects
_____ programming distributes the load to prevent a server from getting overloaded with program-related requests.
Client-side
Which of the following is created by a programmer for use in an application.
Customized objects