I am trying to remove dependency on jQuery from a project. Currently I have something like this…
$("#input").ontouchstart = myFunction;
Now I want to use vanilla js like this
somehowBind('touchstart', document.getElementById('input'), myFunction)
I don’t mind the syntax, just want the same functionality.
Yep, should be:
Although I’ve never heard of the “touchstart” event. Is it Mobile only?