Hi I have a table structure
<table id ="tbl1" >
<thead>
<tr>
<td></td>
<td>
<button class="btn-danger btn fileinput-button" type="button">-</button></td>
</tr>
</thead>
</table>
I have to build dynamic rows in javascript…I am using the below code to generate..
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var cell1 = row.insertCell(0);
cell1.innerHTML = filename;
var cell2 = row.insertCell(1);
var element2 = document.createElement("button");
element2.type = "button";
element2.className = "btn-danger btn fileinput-button";
var element3 = document.createElement("span");
element3.innerHTML = "-";
element2.appendChild(element3);
cell2.appendChild(element2);
The above code works fine in Fire fox but in ie button td is not creating. Could any one help on this.
Many Thanks
Anna
An alternative to this in jQuery:
the error is coz of this line in ur code:
element2.type = "button";