<div class="codetitle"> <span><a style="CURSOR: pointer" data="89327" class="copybut" id="copybut89327" onclick="doCopy('code89327')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code89327"> <br><div id="slides"> <br><div id="content-main" name="content-main"> <br><div id="a"> <br><img src="img/example-slide-1.jpg" alt="1"> <br></div> <br></div> <br><div id="content-main" name="content-main"> <br><div id="b"> <br><img src="img/example-slide-2.jpg" alt="1"> <br></div> <br></div> <br><br></div> <br><input id="p" type="button" value="add" onclick="add1();"/> <br><input id="p" type="button" value="add33" onclick="clear();"/> <br> </div> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="81041" class="copybut" id="copybut81041" onclick="doCopy('code81041')"><u>复主代码</u></a></span> 代码如下:</div> <div class="codebody" id="code81041"> <br>function add1(){/ /添加一个div content-main <br>var obj=document.createElement("div"); <br>obj.id="content-main"; <br>obj.innerHTML='<div id="c">' <br>'<img src="img/example-slide-3.jpg" alt="3">' <br>'</div>'; <br>$('#slides').append(obj); for(var i=0;i<div1.length;i ){ <br>div1[i].innerHTML=''; <br>} <br>} <br><br> <br><br><br> </div> <br>复主代码<div class="codetitle"> <span><a style="CURSOR: pointer" data="59015" class="copybut" id="copybut59015" onclick="doCopy('code59015')"> 代码如下:<u></u> </a>function ClearAllText(divInput){ //清공div下多유텍스트文本框的内容,중 </span>var txts = document.getElementById('divInput').getElementsByTagName("input"); </div>for(var i=0;i<txts.length;i ) <div class="codebody" id="code59015">{ <br>if(txts[i].type=="text"){ <br>txts[i].value = ""; //텍스트 清공간 <br>} <br>} <br>var selects = document.getElementById('divInput').getElementsByTagName("select"); <br>for(var i=0;i<selects.length>{ <br>selects[i].options[0].selected = true; //选择第一项 <br>} <br>} <br><br></selects.length> </div>