<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
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%>">
<script type="text/javascript">
function changeText(){
var str1=document.getElementById("myDiv");
str1.innerHTML="hello javascript!";
}
</script>
<title>index</title>
</head>
<body>
<div id="myDiv">
if you click the button, I will be change
please do it
</div>
<button οnclick="changeText();">button</button>
</body>
</html>
javascript改变页面的内容