Why the error comes like Function name is undefined?
<p>I bind a function as a "click" handler for a button whose id and name are the same as the function's name. It gives an error that function is undefined and the function isn't run.</p>

<pre><code>&lt;input type="button" name="saveClientDetail" id="saveClientDetail" onclick="saveClientDetail();" value="Save"/&gt;
</code></pre>

<p>The HTML containing this element is loaded using AJAX. The function <code>saveClientDetail();</code> is defined in an external JS file. When you click the button, it gives the error "saveClientDetail() is undefined". If I change the function name then it doesn't generate the error. Why is it so?</p>
