scripts/todo.js
// when the user click the plus or minus button to change quantity
when the user click the plus or minus button to change quantity
when the user click the plus or minus button to change quantity
function quantity_change(button_id){
    if (button_id == "couch_minus" || button_id == "couch_plus") {
        var number_field = document.getElementById("couch_quantity");
        var quantity = parseInt(number_field.value);
        if (button_id == "couch_minus") {
            number_field.value = (quantity>0) ? quantity-1 :0;
        }
        if (button_id == "couch_plus") {
            number_field.value = quantity+1;
        }
    }
}
function quantity_change ( button_id ) { if ( button_id == "couch_minus" || button_id == "couch_plus" ) { var number_field = document . getElementById ( "couch_quantity" ) ; var quantity = parseInt ( number_field . value ) ; if ( button_id == "couch_minus" ) { number_field . value = ( quantity > 0 ) ? quantity - 1 : 0 ; } if ( button_id == "couch_plus" ) { number_field . value = quantity + 1 ; } } }
when the user click the plus or minus button to change quantity
when the user click the plus or minus button to change quantity