Display a prompt box (dialog) : Dialog « Window Browser « JavaScript DHTML
- JavaScript DHTML
- Window Browser
- Dialog
Display a prompt box (dialog)
<html>
<head>
<script type="text/javascript">
function disp_prompt(){
var name=prompt("Name","")
if (name!=null && name!=""){
document.write(name)
}
}
</script>
</head>
<body>
<form>
<input type="button" onclick="disp_prompt()" value="Display a prompt box">
</form>
</body>
</html>
Related examples in the same category