I have the following jquery code.
var destTable = $("#numbers");
$(document).ready(function() {
$("#btnAdd").click(function() {
//Take the text, and also the ddl value and insert as table row.
var newRow = $("<tr><td>hi</td></tr>");
$("#numbers").append(newRow);
});
});
What I would really like is to store a reference to an element once and then use it from there on it.
The code above add's a row to my table as expected but if I use. $(destTable).append(newRow)
or destTable.append(newRow)
nothing happens could anyone shed any light on this for me?
Thanks