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”?

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”?

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 0

Your email address will not be published. Required fields are marked *