mercredi 2 septembre 2015

Is there any way to have a checkbox add a number "1" into a number type box upon clicking?

Is there any way I can have a user check a box and it automatically adds a number 1 in a corresponding number box? This is what I have so far, but it's not adding a number into the box when I check it. Where am I going wrong?

$(document).ready(function () {
    $(".copyMe").keyup(function () {
        $(".copyMe").val($(this).val());
    });
});
<input class="copyMe" type="checkbox" />
<input class="copyMe" type="number" />



Aucun commentaire:

Enregistrer un commentaire