I’m facing a troubles around jQuery and HTML elements.
Let’s to the “Artists”:
<table id="tableBenef" width="375px">
<tr style="border-bottom: solid 1px silver;">
<td style="width: 10%"> Action </td>
<td style="width: 45%"> Nome </td>
<td style="width: 20%"> Data Nasc </td>
<td style="width: 25%"> Grau Parent </td>
</tr>
</table>
This above is the Table Header and Inside of it I add dinamically new Rows. Each row contains a Checkbox and three more TDs, also I have three text inputs which I send each of one to the referent TD, the checkbox is for Delete purposes.
The question is, How to Get those new values inserted dinamically with jQuery?!
I started with this code below:
function getRowValues() {
var table = $("#tableBenef");
$(table).each(function () {
alert($(this).text());
})
};
But I’m facing trouble with that, could someone help me on this?
In negative case, thanks anyway!
Sorry for any mistake.
Cheap solution: don’t get them back from the HTML at all. Instead, before inserting each row into the HTML, store that row’s values in an array. Then, just read the array rather than having to go all the way back through the DOM.
As requested, here is some very basic code for how you’d go about doing this. (Obviously, this is just code to illustrate the general idea, since I don’t know your actual setup.)