The conditions to apply a given action to each table row are :
- contains the word "keyword"
- value attribute of input tag equals to "2"
With this code, it works only with the first row :
$('table.tab-shopping-cart > tbody > tr.hproduct').each(function () {
var qtty = $('input.basketstep_update').val();
var product = $('td.col-description a').text().indexOf("keyword");
if (product >=0 && qtty == 2) {
$(this).css('background-color','green') // dumb action to the row
}
})
HTML
<table class="tab-shopping-cart">
<tbody>
<tr class="hproduct">
<td class="col-description"><a>keyword</a></td>
<td class="col-qty">
<div>
<input class="basketstep_update" value="3">
</div>
</td>
</tr>
<tr class="hproduct">
<td class="col-description"><a>keyword</a></td>
<td class="col-qty">
<div>
<input class="basketstep_update" value="2">
</div>
</td>
</tr>
</tbody>
</table>
Thanks for helping