I recently made a full virtual keyboard for my web application and I would like to add a button to simulate the enter key.
For example, when the user types something in an input field and presses the Enter key on the virtual keyboard, I want the input field to search the website for what they've typed.
I finished the searching part but all what I need is to add a virtual enter key to the keyboard.
How can I create a button that would simulate a physical enter key press?
Update: Thank you all for helping me out! But unfortunately none of the answers below solved my issue :-(
However I found a workaround for the problem
I put my input field in a form like this
<form> <input type = "text" placeholder = "Search The website"></input></form>
Then I added a button right next to the input field inside the form like this
<form> <input type = "text" placeholder = "Search The website"></input>
<button>Search</button>
</form>
And that automatically solved my problem I didn't get to simulate the enter key after all. But I found this easy workaround. I didn't even need any JavaScript. So yeah thank you all for trying to help me out.