Case-Based Critical Thinking Questions
?
Case 11-5
?
Ashton has created a website for his company using JavaScript. He wants to add dialog boxes to the website to display messages and allow the user to input text.
?
Ashton wants to create a dialog box for his website that asks the user to select OK or Cancel when he or she decides to leave the website. Which of the following commands should Ashton use to do this?

A. alert(text)
B. prompt(text[, defaultInput])
C. confirm(text)
D. print(text)


Answer: C

Computer Science & Information Technology

You might also like to view...

Analyze the following code.

``` public class Test { public static void main(String[] args) { int n = 2; xMethod(n); System.out.println("n is " + n); } void xMethod(int n) { n++; } }``` a. The code has a compile error because xMethod does not return a value. b. The code has a compile error because xMethod is not declared static. c. The code prints n is 1. d. The code prints n is 2. e. The code prints n is 3.

Computer Science & Information Technology

A watermark is typically inserted into the header of a worksheet

Indicate whether the statement is true or false.

Computer Science & Information Technology

What type of fiber optic cable enables multiple light signals to be sent along the same cable?

A) Plastic B) Glass C) Crystal D) None of these answers are true.

Computer Science & Information Technology

? The item marked 2 in Figure 3.1 represents thehiddenvalue of the overflow property. 

Answer the following statement true (T) or false (F)

Computer Science & Information Technology