Onblur giving continuous alert in loop when clicked from 1 textbox to another
<p>I am currently calling an on blur function for all textboxes,like below:</p>

<pre><code>&lt;input type="text" id="fname" onblur="myFunction()"&gt;
&lt;input type="text" id="fname2" onblur="myFunction()"&gt;
</code></pre>

<p>which validates the input provided and gives an alert in case of mismatch. The issue I am facing here is When the user blurs from 1 textbox and directly focusing to another checkbox. The Alert continuously apprears. because it considers the click of ok of the alert as a blur of the textbox.
I could use onchange. But onchange is giving me an issue in IE.
I have duplicated a sample code here:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function myFunction() {
  alert("Value Changed");
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>Enter your name:
&lt;input type="text" id="fname" onblur="myFunction()"&gt;
&lt;input type="text" id="fname2" onblur="myFunction()"&gt;
&lt;p&gt;When you leave the input field, a function is triggered which transforms the input text to upper case.&lt;/p&gt;</code></pre>
</div>
</div>
</p>