用window.prompt,试例如下
<script>
function getMsg(){
  var msg =  window.prompt;
  alert(msg)
  return msg;
}
</script>
也可以用window.showModalDialog