<div class="codetitle"> <span><a style="CURSOR: pointer" data="87560" class="copybut" id="copybut87560" onclick="doCopy('code87560')"><u>复制代</u></a></span> 代码如下:</div> <div class="codebody" id="code87560"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <BR><html xmlns="http://www.w3.org/1999/xhtml"> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <br><title>createElement</title> <br><style type="text/css"> <br>.warpper{ border:1px 赤一色;パディング:8px;} <br></style> <br><script type="text/javascript" language="javascript" src="JavaScript/jquery-1.6.1.min.js" ></script> <br><script type="text/javascript" language="javascript"> <br><!-- <BR>///アニメーション态创建一个div <BR>$(function(){ <BR>$('<div />',{ <br>id:'test' , <br>text:"これは div です", <br>"class":"warpper", <br>click:function(){ <br>var text=$(this).text(); >アラート(テキスト); <br>} <br>}).appendTo("本文"); <br>//创建input:text <br>$(function(){ <br>$('<input />',{ <br>type:"text", <br>val:"入力テキスト何か...", <br>name:"userName" <br>}).appendTo("body"); <br>}); <br>//创建input select <br>$(function(){ <br>var slt=$('<select />',{name:"country" }); <br>$('< ;option />',{ <br>val:"0", <br>text:"请选择" <br>}).appendTo(slt); <br>$('<option>',{ <br>val:"CN", <br>text:"中国", <br>selected:"selected" <br>}).appendTo(slt); <br>$("body").append(slt) );<br>}); <br>//创建ラジオ <br>$(function(){ <br>$('<input />',{ <br>type:"radio", <br>name:"rdo", <br>checked:"チェック済み", <br>val:"男" <br>}).appendTo("body"); <br>$('<label>',{ <br>text:"男" , <br>}).appendTo("body"); <br>$('<input />',{ <br>type:"radio", <br>name:"rdo", <br> val:"女" <br>}).appendTo("体"); <br>$('<label>',{ <br>text:"女" <br>}).appendTo("体" );<br>}); <br>//チェックボックスを作成します <br>$(function(){ <br>$('<input />',{ <br>type:"checkbox", <br>name:"cbox", <br>val:"1", <br>checked:"チェック済み" <br>}).appendTo("body") <br>}); <br>$(function(){ <br>$('<input />',{ <br>type:"file", <br>name:"myfile" <br>}).appendTo("ボディ");<br>}); <br>//--> <br></script> <br></head> <br> <br> <br></body> <br></html> <br><br> </div>