JavaScript Vibration API

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Modern mobile devices include hardware for vibrations. The Vibration API offers Web apps the ability to access this hardware, if it exists, and does nothing if the device doesn't support it.

Syntax

  • let success = window.navigator.vibrate( pattern );

Remarks

Support by browsers might be limited. Also support by the operating system may be limited.

The following table gives an overview of the earliest browser versions that provide support for vibrations.

ChromeEdgeFirefoxInternet ExplorerOperaOpera MiniSafari
30no support16no support17no supportno support


Got any JavaScript Question?