title: Preventing onchange events from getting into an infinite loop
body: <p>I have two text fields, one represents a percentage and the second represents a corresponding amount. Now what I want is, when the percentage changes the amount should change and when the amount changes the percentage should change accordingly. I am using javascript.</p>
  
  <p>In this case, if any of them changes an infinite loop will start.</p>
  
  <p>What I would like is that when the amount changes, it should change the percentage accordingly and then the loop should stop. And when the percentage changes, it should change the amount accordingly and then the loop should stop. Is there any way for this? Maybe something like <code>stopPropagation</code> ?</p>
  
  <p>Dummy JS Code:</p>
  
  <p>Here <code>value</code> is one text box and <code>percentage</code> is another text box</p>
  
  <pre><code>function valueChng(){
      percentage.value = "" + someInteger;
  }
  function percentageChng(){
      value.value = "" + someInteger;
  }
  </code></pre>
  
  <p>Thanks!!</p>