Copy Code code as follows:
<div id= "Slides" >
<div id= "Content-main" name= "Content-main" >
<div id= "a" >
</div>
</div>
<div id= "Content-main" name= "Content-main" >
<div id= "B" >
</div>
</div>
</div>
<input id= "P" type= "button" value= "Add" onclick= "add1 ();" />
<input id= "P" type= "button" value= "add33" "onclick=" clear (); " />
Copy Code code as follows:
function Add1 () {//Add a div content-main
var obj=document.createelement ("div");
Obj.id= "Content-main";
Obj.innerhtml= ' <div id= ' C ' > ' +
' ' +
' </div> ';
$ (' #slides '). Append (obj);
}
function Clear () {//Erase All div and img under slides
var Div1=document.getelementbyid ("Slides"). getElementsByTagName ("div");
for (Var i=0;i<div1.length;i++) {
Div1[i].innerhtml= ';
}
}
Copy Code code as follows:
function Clearalltext (divinput) {//empty div with more text text box contents, resetting
var txts = docu Ment.getelementbyid (' Divinput '). getElementsByTagName ("input");
for (Var i=0;i<txts.length;i++)
{
if (txts[i].type== "text") {
Txts[i].value = "";//text empty
}
}
var selects = document.getElementById (' Divinput '). getElementsByTagName ("select");
for (Var i=0;i<selects.length;i++)
{
selects[i].options[0].selected = true;//select First
}
}