js弹出输入框

js弹出输入框

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
<script type="text/javascript">
function disp_prompt(){
	var name=prompt("请出入您的名字","Bill Gates");
	if(name!=null && name!=""){
		document.write("你好!" + name + "今天过得怎么样/")
	}
}
</script>

  </head>
  
  <body>
    <input type="button" onclick="disp_prompt()" value="消息提示框">
  </body>
</html>

你可能感兴趣的:(JavaScript)