在线等待,如何动态创建一个按纽,并给这个按纽绑上一个Onclick事件?

如题
请提供相关的示范代码,立即给分
---------------------------------------------------------------

 1<body>
 2<script language="JavaScript">   
 3<!--   
 4var o=document.createElement("input");   
 5o.type="button";   
 6o.value="test"   
 7o.onclick=new Function("test(this)");   
 8document.body.appendChild(o);   
 9function test(b){ alert(b.value);}   
10//-->   
11</script>
12</body>
Published At
Categories with Web编程
comments powered by Disqus