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.
<input type="button" name="saveClientDetail" id="saveClientDetail" onclick="saveClientDetail();" value="Save"/>
The HTML containing this element is loaded using AJAX. The function saveClientDetail();
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?