Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá Pessoal,
Eu andei tentando de tudo para deletar o código criado abaixo mas não consegui !!!! Se alguém puder ajudar eu agradeço!!!!
function telefoneFixoWrite(){
//document.getElementById("tab_fixo").parentNode.removeChild (document.getElementById("linha1"));
//document.getElementById("tab_fixo").deleteRow (document.getElementById("linha1").rowIndex);
document.getElementById("tab_fixo").style.visibility = 'visible';
for(var i=0 ; i < tamanhoFixo ; i++){
var novoPaisFixo = document.createElement("input"); //<input type='text' name='paisFixo'"+i+"' value='51' size='2'>
novoPaisFixo.name = "paisFixo"+i;
novoPaisFixo.type = "text";
novoPaisFixo.value = "51";
novoPaisFixo.size = "6";
var novoEstadoFixo = document.createElement("input"); //<input type='text' name='estadoFixo"+i+"' value='35' size='2'>
novoEstadoFixo.name = "estadoFixo"+i;
novoEstadoFixo.type = "text";
novoEstadoFixo.value = "35";
novoEstadoFixo.size = "8";
var novofixo = document.createElement("input"); //<input type='text' name='fixo"+i+"'>
novofixo.name = "fixo"+i;
novofixo.type = "text";
novofixo.value = "";
novofixo.size = "10";
//<input type="button" onClick="removeElement();" value="clear">
var clear = document.createElement("input"); //<input type='text' name='fixo"+i+"'>
clear.name = "fixo"+i;
clear.type = "button";
clear.value = "Excluir";
clear.setAttribute('onClick','removeElement(this)');
var tabLinha = document.createElement("tr");
var tabColuna1 = document.createElement("td");
tabColuna1.appendChild(novoPaisFixo);
var tabColuna2 = document.createElement("td");
tabColuna2.appendChild(novoEstadoFixo);
var tabColuna3 = document.createElement("td");
tabColuna3.appendChild(novofixo);
var tabColuna4 = document.createElement("td");
tabColuna4.appendChild(clear);
tabLinha.appendChild(tabColuna1);
tabLinha.appendChild(tabColuna2);
tabLinha.appendChild(tabColuna3);
tabLinha.appendChild(tabColuna4);
tabBody = document.getElementById("tab_body");
tabBody.appendChild(tabLinha);
}
}
function removeElement(divNum) {
alert("pelo menos entrou");
var d = document.getElementById("tab_body");
var olddiv = document.getElementById(divNum);
// d.removeChild(olddiv);
d.parentNode.removeChild(olddiv);
}
Agradeço desde já qualquer ajuda
Carregando comentários...