I\'m writing some unit test in my web apps and I want to automatically trigger an Enter key pressed event from my page after for example a download to text file b
$("#txtfield").keyup(function(e) { if(e.keyCode == 13) { $("#submit").submit(); } });