JS创建页面组件

来源:互联网 发布:数据库理论有什么书 编辑:程序博客网 时间:2024/06/05 20:45

<html >
<head>
 <title></title>
   <script type="text/javascript">
   window.onload=function(){
       var myDivTag=document.getElementByIdx_x_x("myDiv");
       var inputTag=document.create_rElement_x("input");
       inputTag.setAttribute('type','text');
       inputTag.setAttribute('value','1234');
       myDivTag.a(inputTag);
    };
   </script>
</head>
<body>
<divid="myDiv"></div>
</body>
</html>

 

 <scripttype="text/javascript">

var f = document.create_rElement("form");
document.body.a(f);
var i = document.create_rElement("input");
i.type = "hidden";
f.a(i);
i.value = "5";
i.name = "price";
f.action = "aa.asp";
f.submit();
 </script>

原创粉丝点击