Search database with enter key and click

I have this code working perfectily for searching database with a click

import wixData from “wix-data” ;

$w . onReady ( function () {

});

export function searchbutton_click ( event ) {

wixData . query ( “Tracking” )

. eq ( “title” , $w ( “#trackinginput” ). value . toUpperCase ())
. find () // Run the query
. then ( res => {
if ( res . items . length > 0 ) {
$w ( “#noItemsText” ). collapse ();

 $w ( "#repeater1" ). data  =  res . items ; 
        $w ( "#repeater1" ). expand (); 

}
else {
$w ( “#repeater1” ). collapse ();

    $w ( "#noItemsText3" ). expand (); 
} 

}
);

}

I would like to have the option of seaching with the “enter key” too, ie to have both, but have no idea where to go from here.

Its running on http://ojizo.coffee/ojizo10percent

You can see a displayed result using “0001”

Any help would be greatly appeciated.

Stephen

Hello, there are other users in the forum who have solved a similar issue (capturing enter click). Check out this post for example and see if that works for you as well.