jquery - Simulate and fire enter keypress in JavaScript -


i trying run number of automated (simple) js tests on website , simulate , trigger enter key press on input field (its not in form , not use form, not wish edit code). i've been trying stuff along lines of:

$('#inputfield').trigger($.event('keypress', { which: 13, keycode: 13 })); 

i've gone through countless answers on internet, none have helped , wondering if suggest why should trivial matter.

  • using chrome v. 49
  • can use jquery

thanks.


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -