A click is defined as "holding the mouse button and then releasing the mouse button." This is a combination of a mouse event and a mouse executed on the same element. If the user moves away from the element, they no longer click, just mousedown (as well as the mouse, and then the mouse on another element).
This is standard, intuitive behavior. Users do not expect their click โmatterโ if they do not release the mouse without moving.
If for your application this is really important than ANY click result in this view for you, then do not go with onclick, go with onmousedown.
<a class="button" href="javascript:void(0);" onmousedown="submitActivity();">Add</a>
EDIT: Your problem is not clear. Perhaps this syntax I'm used to working for will work for you:
<INPUT type="button" value="Add" name="add_button" onClick="submitActivity()">
source share