Question

I have lots of input fields using the Jquery Masked Input but I can't figure out how to capture the change of the value on the input.

I have tried:

JQuery.Change()

$('#Selector').bind('input', function () {})

But, no success.

Anyone could help me?

Was it helpful?

Solution

Do you just mean this?:

$('#Selector').change(function () {
    // respond to the change
})

Or, if your elements are dynamically being added to the DOM, you might use:

$(document).on('change', '#Selector', function () {
    // respond to the change
});

(You don't have to use document as the common parent element, any common parent element will work.)

Depending on the type of the input (and sometimes on the browser, unfortunately), you might try other events as well, such as keypress, keyup, even blur in some cases.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top