I'm using Chosen jQuery plugin and noticed that the change
event is working only when the page loads, NOT every time the input
field is being change.
How can I make it work every time the user changes the value of the input field?
Here is my code:
$("#day").chosen().change({
console.log('working');
});
Am I missing something?
To fire the standard change event, use like:
$('#day').on('change', function(e) {
// triggers when whole value changed
console.log("value changed");
});
To fire the event on each key press,
$('#day').on('keyup', function(e) {
// triggers when each key pressed
console.log("key pressed");
});
To know about the default events of chosen, refer here.
Try this:
$(document).ready(function(){
$("selector").chosen().change(function(){
var id = $(this).val();
});
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With