Very easy example for keyboard and mouse that works with a Feather M0, no special libraries needed, here.
Another nice tutorial here
A tutorial on fetch in particular is here
jquery approach here
more elaborate description here
cross-browser support here
Suggestion of using Accessibility Services, here
18 OCT 2020
Working example here -- presses the 'u' key on a button press.