window.prompt() and prompt()
prompt() dialog prompts the user for input.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<script type="text/javascript">
var result = prompt("What is your name? ", "");
if (result !== null) {
document.writeln("Welcome, " + result);
}
</script>
</body>
</html>
Home
JavaScript Book
DOM
JavaScript Book
DOM
Window:
- The Window Object
- The Window Events
- window.alert() or alert()
- window.close()
- window.confirm() or confirm()
- window.find() displays find dialog
- window's outer width and height, inner height and width
- window.location
- window.moveBy(distance, distance)
- window.moveTo(x,y) moves the window to the upper-left coordinate
- window.open()
- window.print()
- window.prompt() and prompt()
- window.resizeTo(x,y) and window.resizeBy(xDelta,yDelta)
- window.scrollTo(x,y)
- window.screenLeft, window.screenX, window.screenTop, window.screenY
- window.setInterval() or setInterval()
- window.setTimeout() or setTimeout()
- Pop-up Blockers