I have to implement following issue. I have input and i need to show warning message if its value has changed. But for some reasons alert shows few times, can't figure out why. Here was the first question.
$("#input").bind("propertychange change paste input", function(){
alert("Value has been changed");
});
The second question:
How can i check if input's value has changed dynamically. For example if i click on some element then value changes.
$("a").click(function(){
$("#input").val("test");
})
Here's a fiddle i've created.
Any ideas? Thanks in advance!
There is no event raised when an inputs value is changed dynamically. Your best option is to manually raise an event upon changing the value:
$("a").click(function(){
$("#input").val("test").trigger('change');
})
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