tabs() : when ENTER is pressed in an <input>, jumps to another Tab
I have a search field within a third tab using the .tabs() UI.
As I want, the <input> responds to person pressing on ENTER.
(The alert "pressing enter worked' pops up.) However, it also jumps to the first tab.
I don't know why?
Thanks for any help in advance. Sushi
HTML
- <input type="text" name="search" id="search" value="Search" onFocus=this.value=''></input>
jQuery
- $('#search').bind('keyup', function (e) {
- var key = e.keyCode || e.which;
- if (key === 13) {
- alert("pressing enter worked");
- };
- });