用window.prompt,试例如下
<script>
function getMsg(){
var msg = window.prompt;
alert(msg)
return msg;
}
</script>
也可以用window.showModalDialog
<script>
function getMsg(){
var msg = window.prompt;
alert(msg)
return msg;
}
</script>
也可以用window.showModalDialog
my=prompt();
my就是了啊
<INPUT TYPE="text" id="txt">
<INPUT TYPE="button" VALUE="Prompt" ONCLICK="txt.value=window.prompt('what\'s your name', '');">
</BODY>