title: jquery check if input value has changed dynamically
body: <p>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.</p>
  
  <pre><code>$("#input").bind("propertychange change paste input", function(){
      alert("Value has been changed");
  });
  </code></pre>
  
  <p><strong>The second question:</strong></p>
  
  <p>How can i check if input's value has changed dynamically. For example if i click on some element then value changes.</p>
  
  <pre><code>$("a").click(function(){
      $("#input").val("test");
  })
  </code></pre>
  
  <p>Here's a <a href="http://jsfiddle.net/W4Km8/1700/" rel="noreferrer">fiddle</a> i've created.</p>
  
  <p>Any ideas? Thanks in advance!</p>