prompt()弹出框内容的传参

来源:互联网 发布:.xyz域名要备案吗 编辑:程序博客网 时间:2024/05/21 09:22
<html>
<head>
<script type="text/javascript">
function disp_prompt()
  {
  var name=prompt("请输入您的名字","Bill Gates")
  if (name)
    {
     var aa = document.getElementById("aa");
     aa.value = name;
    }
  }
</script>
</head>
<body>


<input type="type" onclick="disp_prompt()" value="显示一个提示框" id="aa"/>


</body>
</html>
0 0
原创粉丝点击