Web pages can use the Vibration API

The web has a small API for asking a device to vibrate. Pass a duration in milliseconds to navigator.vibrate():

navigator.vibrate(200); // Vibrate for 200 ms.

An array alternates vibration and pause durations, which makes patterns possible:

navigator.vibrate([
  100, 30, 100, 30, 100, 30,
  200, 30, 200, 30, 200, 30,
  100, 30, 100, 30, 100
]); // “SOS” in Morse code.

Nothing happens when the device has no vibration hardware or the browser does not support the API. I would keep this as optional feedback, never the only way to communicate something important. A vibrating website can become irritating remarkably quickly.