Hi
I'm trying to add and remove some rows from a table using Jquery. But I dont know how to remove the newly added rows. If I have a remove link it will work, but thats not what I want. I want to be able to call a js function that shall remove all items.
I have tried iterate over the items, but the count for the tr's in the table are always 0.
<script src="scripts/jquery-1.3.2.min.js"></script>
<script language=javascript>
function UpdateData() {
var dataStructure = new Object();
dataStructure.Start = "Added Start";
$("#table tbody tr:first").remove();
InsertDataInToTable(dataStructure);
}
function InsertDataInToTable(dataStructure) {
var newRow = $("#table thead tr:first").clone();
newRow.find("td").eq(0).text(dataStructure.Start);
newRow.insertAfter("#table tbody");
}
Start Inital start