<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 전환//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" 언어="javascript" src="JavaScript/jquery-1.6.1.min.js" ></script> <br><script type="text/javascript" 언어="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>} <br>}).appendTo("body") <br>}); <br>//创建input:text <br>$(function(){ <br>$('<input />',{ <br>type:"text", <br>val:"input text 뭔가...", <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>값:"CN", <br>텍스트:"중국", <br>선택됨:"선택됨" <br>}).appendTo(slt) <br>$("body").append(slt ) <br>}); <br>//创建radio <br>$(function(){ <br>$('<input />',{ <br>type:"radio", <br>name:"rdo", <br>checked:"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("body") <br>$('<label>',{ <br>text:"여자" <br>}).appendTo("body" ) <br>}); <br>//체크박스 생성 <br>$(function(){ <br>$('<input />',{ <br>type:"checkbox", <br>name:"cbox", <br>val:"1", <br>checked:"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> </div>