Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
All Objects
Window Object
window.alert
window.confirm
METHOD: Window::prompt
window.
prompt
(message[, defaultInput])
This method displays a dialog box prompting the user for some input. The optional
defaultInput
parameter specifies the text that initially appears in the input field.
The following example prompts the user for their name and then writes a personalized greeting to the page.
Code:
<body onload=greeting()>
<script type="text/javascript">
function greeting() {
y = (prompt("Please enter your name.", "Type name here"))
document.write("Hello " + y)
}
</script>
Output:
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information