I have one text input and one button (see below). How can I use JavaScript to trigger the button\'s click event when the Enter key is pressed ins
txtSearch.onkeydown= e => (e.key=="Enter") ? btnSearch.click() : 1
txtSearch.onkeydown= e => (e.key=="Enter") ? btnSearch.click() : 1 function doSomething() { console.log('