Jquery check if input value has changed dynamically
I need to accomplish the following problem. I have an input and I need to show a warning message if its value has changed. But for some reason the warning shows multiple times, can't figure out why. Here's the first question.
$("#input").bind("propertychange change paste input", function(){
alert("Value has been changed");
});
Second question:
How can I check if the input value has changed dynamically. For example, if I click on some element, then the value changes.
$("a").click(function(){
$("#input").val("test");
})
Here's the fiddle I created.
Any ideas? Thanks in advance!
+3
source to share
3 answers