if(document.getElementById('button').clicked == true) { alert("button was clicked"); }
<input id="button" type="submit" name="button" value="enter"/>