You should be able to accomplish a tad easier by making it a form and the input button a submit input type.  Hitting enter will automatically submit the form, as will clicking the button.