window.prompt()
In this chapter you will learn:
Prompt dialog
prompt()
dialog prompts the user for input.
<!DOCTYPE HTML> <!--from j a va 2 s. c om-->
<html>
<body>
<script type="text/javascript">
var result = prompt("What is your name? ", "");
if (result !== null) {
document.writeln("Welcome, " + result);
}
</script>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » Javascript Tutorial » Window