这里只是一个很简单的例子:
1<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
2<HTML>
3<HEAD>
4<TITLE> New Document </TITLE>
5<META NAME=\"Generator\" CONTENT=\"EditPlus\">
6<META NAME=\"Author\" CONTENT=\"\">
7<META NAME=\"Keywords\" CONTENT=\"\">
8<META NAME=\"Description\" CONTENT=\"\">
9<script language=\"javascript\">
10 function myTest(d)
11 {
12 if(!document.getElementById(\"txt1\"))
13 {
14 var txt = document.createElement(\"input\");
15 txt.id = \"txt1\"
16 txt.type = \"text\";
17 txt.value = d.innerHTML;
18 d.innerHTML = \"\";
19 var btnSubmit = document.createElement(\"input\");
20 btnSubmit.type = \"button\"
21 btnSubmit.id = \"btnSubmit\";
22 btnSubmit.onclick = aaa;
23 btnSubmit.value = \"修改\" [Page]
24 d.appendChild(txt);
25 d.appendChild(btnSubmit);
26 }