PrepAway - Latest Free Exam Questions & Answers

What does this script do in terms of the use of the variable "name"?

Consider the following script:
<SCRIPT>
<!–var name;
name=prompt(“What is your name?” , “”);
alert(“Hello, ” + name +”.”);
// –>
</SCRIPT>
What does this script do in terms of the use of the variable “name”?

PrepAway - Latest Free Exam Questions & Answers

A.
The variable value is assigned via the prompt method, and then displayed via the alert method.

B.
The variable value is assigned via the prompt method.

C.
Nothing. This script would result in an error.

D.
The variable value is assigned via the alert method.


Leave a Reply