CIS 223 CH 1
A prompt is used in a program to tell the user to enter some data.
True
The onload event is used to have JavaScript execute before the user begins to view the page.
True
The prompt() method allows you to prompt the user to input values.
True
To define a function, you must use the function keyword.
True
Which is the first step in the program development cycle?
analyze the problem
Which of the following describes a JavaScript method?
anything something you can click on can do
Which of the following describes a JavaScript property?
anything that describes something you can click on
Which of the following describes a JavaScript object?
anything you can click on
The innerHTML property allows you to retrieve information from an element on a web page.
false
Which is the correct way to define a function named getAge()?
function getAge() { body of function }
Which method will retrieve the contents of an HTML element?
getElementById()
Which of the following will open a new window named mywindow that is 500 pixels in height and 350 pixels wide?
mywindow = window.open("", "", "height = 600, width = 350");
Which of the following will close a window named mywindow ?
mywindow.close();
Which of the following is not a control structure?
sequence
Which of the following would retrieve the value displayed in a <div></div> element which has id = "football" and store that information in a variable named sport?
sport = document.getElementById("football");
Which of the following will prompt the user to enter his or her name?
var name = prompt("What is your name?");
Which method allows you to display text on an HTML page?
write()
In most cases the words function and method mean the same thing.
False
The last step in the program development cycle is to code the program.
False
The write() method can only be used to display text within <p></p> tags.
False
If the variable hours = 10, what is the value of the variable salary after the following instruction has been executed: salary = hours * 8
80
Which would be used to have a JavaScript function named hello() execute before the user views a web page?
<body onload = "hello()">