I have a table that lists items and has a quantity textbox column that starts with an initial value of 0.
item name | price | quantity
item1 | $1.00 | 0
item2 | $1.00 | 0
item3 | $1.00 | 0
I want to check if all of the rows have 0 as their value.
I’m currently thinking of using this:
var all_zeros = true;
$('input.item-quantity').each(function () {
//Check for 0 quantity and update all_zeros var
}
Is there a cleaner and hopefully better way of doing this?
The following code will help you:
EDIT: