Web pages can respond to touch and click events. It's a little trickier to write scripts that can handle both types of events.
Let's start with the basic click event. The DIV below will respond to click events. You can click on it with a mouse or your finger if you're using a touchscreen.
This is a DIV that responds to mouse and finger clicks.
It has been clicked 0 times.
While it's easy to handle click events, they seem a little slow for touchscreens since you have to lift your finger for a click to register.
The mousedown and touchstart events allow your app to respond quicker.
Mousedown: 0
Mouseup: 0
This is a DIV that responds to touchstarts, but not mousedowns.
It has been touched 0 times.