- Код: Выделить всё
<script type="text/javascript">
pID=1;
function makeForm(paraID,deleteID,createID) {
myform=document.getElementById("form");
myPara=document.createElement("p");
myPara.setAttribute("id","p"+pID);
myselect = document.createElement("select");
theOption=document.createElement("OPTION");
theText=document.createTextNode("Select A Page To Go");
theOption.appendChild(theText);
myselect.appendChild(theOption);
..............................................................................................
..............................................................................................
myselect.appendChild(theOption);
myPara.appendChild(myselect);
myform.appendChild(myPara);
mybutton=document.createElement("BUTTON");
theText=document.createTextNode("del");
mybutton.appendChild(theText);
mybutton.setAttribute("id","deleteID");
function deleteForm(formID,paraID) {
myform=document.getElementById(formID);
myPara=document.getElementById(paraID);
myform.removeChild(myPara);}
mybutton.onclick="deleteForm('form','p"+pID+"')";
myPara.appendChild(mybutton);
pID++;
}
Я подазриваю что здес гдето ошибка с кнопкой. Но где понять немагу.
- Код: Выделить всё
mybutton=document.createElement("BUTTON");
theText=document.createTextNode("del");
mybutton.appendChild(theText);
mybutton.setAttribute("id","deleteID");
function deleteForm(formID,paraID) {
myform=document.getElementById(formID);
myPara=document.getElementById(paraID);
myform.removeChild(myPara);}
mybutton.onclick="deleteForm('form','p"+pID+"')";
myPara.appendChild(mybutton);