How to delete the row of an html table with js or jquery or css ?, I have a table that shows product records of a Query SQL to my BD, I add a button where it opens a modal to register some data belonging to that record , when I have finished filling the form, I want to delete that row from the table, so far I have a JS function that I place in another button inside the table
the button inside the table if it works, implement the button inside the modal but only deletes the header of the table, this is my function
function Eliminar(i) {
document.getElementsByTagName("table")[0].setAttribute("id", "tableid");
document.getElementById("tableid").deleteRow(i);
}
this is my modal
@<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Agregar Campos</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="contenedor-formulario">
<div class="wrap">
<div id="formularioChip">
<form action="" class="formulario" name="formulario" id="formulario">
<div>
<input type="text" id="icc" name="icc" hidden/><br /><input type="text" id="txtFechaa" name="txtFechaa" /><br />
<div class="input-group">
<input type="text" id="celular" name="celular" class="campos">
<label class="label" for="celular">Celular</label>
</div>
<label style="color: black;">Estatus</label>
<div class="input-group radio">
<select name="estatus" id="estatus">
<option value="" disabled selected>Selecciona Opción</option>
<option value="PARAD">PARAD</option>
<option value="OTROS">OTROS</option>
</select>
</div>
<input type="button" id="btn-submit" value="Enviar">
</div>
</form>
</div>
<div id="muestraMensaje">
<SPAN style="color:black">Exito</SPAN><br />
<input type="button" value="Aceptar" onclick="Eliminar(this.parentNode.parentNode.rowIndex)" />
<button type="button" class="btn btn-success" onclick="remove(this.parentNode.parentNode.rowIndex)">Aceptar</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>