On Sharepoint Online I have created a code snippet and have this code in it:
It works great when you type something in the search box and you click the button with the mouse pointer. As in, it opens the Google screen with the search from the text box in the right place. I.e. it does the Google Search. However, when you enter something in the textbox and press enter instead of running the script, it for some reason opens up the edit function of the Sharepoint page?
UPDATE The code works perfectly if on a blank HTML page. Is it because Sharepoint Online blocks the onKeyDown or something?