Show the prompt() dialog

Description

prompt() dialog prompts the user for input.

Example


<!DOCTYPE HTML> 
<html> 
    <body> 
        <script type="text/javascript"> 
                var result = prompt("What is your name? ", ""); 
                if (result !== null) { <!--  w w w  .j a  va  2 s.  c o m-->
                    document.writeln("Welcome, " + result); 
                } 


        </script> 
    </body> 
</html>

Click to view the demo





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window