<input class="item-quantities valid" data-bomid="1939" data-rid="2054" id="AddedItemIDs_1939_" name="AddedItemIDs[1939]" onkeypress="return isNumberKey(event)" type="text" value="7" aria-invalid="false">
Can't get this to work. What I've tried...
$('.item-quantities, .valid').change(function () {
alert("we are here");
});
or...
$('.item-quantities.valid').change(function () {
alert("we are here");
});
or...
$('.item-quantities').change(function () {
alert("we are here");
});
... and a few other variations.
Can't seem to figure out how to trigger this event. I've been playing around with various variations of $('.item-quantities, .valid'), to no avail. What is the correct way to do this?
You can use oninput and onkeypress event like this: Working fiddle
Or like this
That will do the trick for classes
Try this:
But change event of text only fires on its focus lost, its better to use keypress or keydown
Working fiddle