Forum Moderators: open
and other that Writes one line of JavaScript that prompts the user to input his name and assigns this value to a variable called user_name. For the prompt text, use "Enter your name below.".
Itīs for an exam.
Thanks
The blue and green colors:
<script>
document.write("<font color='green'>Green</font><br>")
document.write("<font color='blue'>Blue</font>")
</script>
--------
And the prompt box (not sure if this was what you were looking for):
<script>
function user_name()
{
var name=prompt("Enter your name below","")
if (name!=null && name!="")
{
document.write(name)
}
}
</script>
<form>
<input type="button" onclick="user_name()" value="Enter your name below">
</form>