I have a problem here, I couldn't set the attribute I wanted inside my table.
<tr id="ROW1" class="duplicate">
<td>
<textarea class="cl_text" cols="20" name="descriptions1"></textarea>
</td>
<td>
<input class="cl_form" size="10" value="" name="expectedDate1">
</td>
<td>
<input class="cl_form" size="10" value="" name="slxInput1">
</td>
...
...
</tr>
I can change the attribute of the TD element but not those within it. I need to change all those elements within the TD elements, it's easy to change the first and last elements but how about the others? If possible, I just wanted to a loop that will do change all those attributes under #ROW1
EDITED: I added my code that isn't working;
$( "#ROW" + Num ).each(function(index) {
temp = $(this).children(":first").attr("name");
$(this).children(":first").attr("name", temp+Num);
});
To change an attribute for all inputs and textareas in the table row:
$('#ROW1 textarea, #ROW1 input').attr('someattr', 'value');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With