There are many ways to clear tags. The following is a good example to understand all the tags under the div. For more information, see
The Code is as follows:
The Code is as follows:
Function add1 () {// Add a p content-main
Var obj = document. createElement ("p ");
Obj. id = "content-main ";
Obj. innerHTML ='
'+
''+
'
';
$ ('# Slides'). append (obj );
}
Function clear () {// clear all p and img under slides
Var p1 = document. getElementById ("slides"). getElementsByTagName ("p ");
For (var I = 0; I P1 [I]. innerHTML = '';
}
}
The Code is as follows:
Function ClearAllText (pInput) {// clear the content of multiple text boxes in p and reset
Var txts = document. getElementById ('pinput'). getElementsByTagName ("input ");
For (var I = 0; I {
If (txts [I]. type = "text "){
Txts [I]. value = ""; // clear text
}
}
Var selects = document. getElementById ('pinput'). getElementsByTagName ("select ");
For (var I = 0; I {
Selects [I]. options [0]. selected = true; // select the first item
}
}