user6394357 user6394357 - 2 months ago 5x
Javascript Question

insert row into datatable with textbox in rails application

I am trying to implement insert two text box with same row in datatable same row of searching box I am trying by following way


$(window).load(function (){
var table = document.getElementById("example");
var row = table.insertRow(0);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
cell1.innerHTML = "NEW CELL1";
cell2.innerHTML = "NEW CELL2";

but i cant to do that...plz help


Couldn't you just do $("#example").append("<tr><td>" + "NEW CELL1" + "</td></tr>");