selecting one row in dynamic table
Hey, i have a table where I need the elements of one row only.
Let's say I have a table where the rows are dynamically made by php:
-
<tr>
<td><input name="balance" type="text" /></td>
<td><input name="interest_rate" type="text" /></td>
<td><input name="term" type="text" /></td>
<td><input name="payment" type="text" /></td>
<td name="missing_type">1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
This will repeat for however many there are in the array.
I want change the background of the 4 input cells if any of the 4 is still empty on change:
So far I have:
-
$('#homeloan tr input').removeClass();
$('#homeloan tr input[name]').addClass('red');
For now i just want to be able to change the background of the cells in one row, but the cells of the whole table changes. How can I change the cells in the row where the change occurred?