Quiz
Test your knowledge of JavaScript windows and frames by answering the following questions.
Questions
Which of the following methods displays a dialog box with OK and Cancel buttons, and waits for a response?
window.alert
window.confirm
window.prompt
What does the window.setTimeout method do?
Executes a JavaScript statement after a delay.
Locks up the browser for the specified amount of time.
Sets the amount of time before the browser exits automatically.
You're working with a document that contains three frames with the names first, second, and third. If a script in the second frame needs to refer to the first frame, what is the correct syntax?
window.first
parent.first
frames.first
Answers
b. The window.confirm method displays a dialog box with OK and Cancel buttons.
a. The window.setTimeout method executes a JavaScript statement after a delay.
b. The script in the second frame would use parent.first to refer to the first frame.