<button onclick="vibrate()">Vibrate for 500ms</button>
<button onclick="vibrateTwoTimes()">Vibrate Two Times</button>
const vibrate = () => {
  window.navigator.vibrate([500])
}

const vibrateTwoTimes = () => {
  window.navigator.vibrate([200, 100, 200])
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.