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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -