Gracias de nuevo djaevi por tus codigos, combinando el primero que me diste mas este otro ultimo di con el codigo final que en verdad era lo que queria y seria el seguiente :)
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Agregar y quitar celdas</title>
<script>
Código Javascript
:
Ver originalfunction myCreateFunction() {
var table = document.getElementById("myTable");
var row = table.insertRow(0);
var fila = table.insertRow();
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
// CREO UN ELEMENTO DEL TIPO INPUT CON document.createElement("NOMBRE TAG HTML QUE QUIERO CREAR");
var input = document.createElement("input");
input.type = "text";
input.className = "urlresp";
input.value = "Url respuesta";
input.setAttribute("onclick", "vaciar_campo(this);");
input.style.height = "20px";
input.style.width = "100px";
// Creo un segundo elemento Input
var input2 = document.createElement("input");
input2.type = "text";
input2.className = "ptss";
input2.value = "0";
input2.setAttribute("onclick", "vaciar_campo(this);");
input2.style.height = "20px";
input2.style.width = "30px";
var campo4 = document.createElement("input");
campo4.type = "button";
campo4.value = "-";
campo4.onclick = function ()
{
var fila = this.parentNode.parentNode;
var tbody = table.getElementsByTagName("tbody")[0];
tbody.removeChild(fila);
}
// CON EL METODO appendChild(); LOS AGREGO A LA CELDA QUE QUIERO
cell1.appendChild(input);
cell2.appendChild(input2);
cell2.appendChild(campo4);
}
function vaciar_campo(input) {
input.value = "";
}
Código HTML:
Ver original
<button onclick="myCreateFunction()" type="button"> <table id="myTable" border="0"> <input name="urlresp" type="text" id="urlresp" style="height: 20px; width: 100px;" onFocus="vaciar_campo(this)" value="Url respuesta"> <input name="ptss" type="text" class="ptss" id="ptss" style="height: 20px; width: 30px;" onFocus="vaciar_campo(this)" value="0">
Gracias de nuevo

.
Saludos