1.
<div id="s" name="s"></div>
<script language="javascript">
<!--
tobj = document.createElement("input");
tobj.type = "text";
tobj.name = "textbox1";
tobj.onClick = test;
document.all["s"].appendChild(tobj);
function test(){
alert("ssss");
}
//-->
</script>
2.
<div id="s" name="s"></div>
<script language="javascript" defer >
<!--
tobj = document.createElement("<input type=text name='textbox1' onclick='test()'>");
//tobj.type = "text";
//tobj.name = "textbox1";
//tobj.onClick = "test()";
document.all.s.appendChild(tobj);
function test(){
alert("ssss");
}
//-->
</script>
posted on 2006-04-03 15:16
汪杰 阅读(664)
评论(0) 编辑 收藏 引用 所属分类:
hengxing网站js