<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Fen Ye</title>
<script type="text/javascript">
window.onload =function(){
var errMsg='<%=request.getAttribute("ErrorMsg")%>' ;
var ul = document.getElementById("info");
ul.setAttribute("sytle","color:#ff0000;");
// h
var h = document.createElement("h3");
h.setAttribute("id", "h3");
h.setAttribute("sytle","color:#ff0000;");
h.innerHTML = errMsg;
ul.appendChild(h);
//添加 li
var li = document.createElement("li");
//设置 li 属性,如 id
li.setAttribute("id", "newli");
li.innerHTML = errMsg;
ul.appendChild(li);
}
</script>
</head>
<body>
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat" selected="selected">Fiat</option>
<option value="audi">Audi</option>
</select>
<div>
<span id="info">
</span>
</div>
</body>
</html>
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Fen Ye</title>
<script type="text/javascript">
window.onload =function(){
var errMsg='<%=request.getAttribute("ErrorMsg")%>' ;
var ul = document.getElementById("info");
ul.setAttribute("sytle","color:#ff0000;");
// h
var h = document.createElement("h3");
h.setAttribute("id", "h3");
h.setAttribute("sytle","color:#ff0000;");
h.innerHTML = errMsg;
ul.appendChild(h);
//添加 li
var li = document.createElement("li");
//设置 li 属性,如 id
li.setAttribute("id", "newli");
li.innerHTML = errMsg;
ul.appendChild(li);
}
</script>
</head>
<body>
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat" selected="selected">Fiat</option>
<option value="audi">Audi</option>
</select>
<div>
<span id="info">
</span>
</div>
</body>
</html>