<script language="JavaScript">
<!--
var o=document.createElement("input");
o.type="button";
o.value="test"
o.οnclick=new Function("test(this)");
document.body.appendChild(o);
function test(b){ alert(b.value);}
//-->
</script>
转载于:https://www.cnblogs.com/shaofh/archive/2006/05/25/409100.html