<%@ 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>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<textarea rows="20" cols="100" id="te">
</textarea>
<br>
/**
点击按钮或者图片在文本域中显示该图片
*/
<input type="button" value="添加图片" οnclick="addImage()" />
<img alt="提示" src="1.jpg" οnclick="addImage()">
<SCRIPT LANGUAGE="JavaScript">
function addImage(){
var img = document.createElement("img");
img.src = "1.jpg";
document.getElementById('te').appendChild(img);
}
</SCRIPT>
</BODY>
</HTML>