JSFiddle - React, Tailwind, and code Playground

by Suresh Shenoy

HTML

<button onclick="Vibrate()">
Vibrate
</button>
<audio id="scan-audio" autoplay>
Your browser does not support the
<code>audio</code> element.
</audio>

JavaScript

function Vibrate(){
alert("starting to vibrate");

/* navigator.vibrate(200); // vibrate for 200ms
navigator.vibrate([
  100, 30, 100, 30, 100, 30, 200, 30, 200, 30, 200, 30, 100, 30, 100, 30, 100,
]); // Vibrate 'SOS' in Morse. */
window.navigator.vibrate([100,30,100,30,100,200,200,30,200,30,200,200,100,30,100,30,100]); 
 play();
}
function play(){
var CurAudio = document.getElementById("scan-audio");
CurAudio.src = getAudio();
alert(CurAudio);
console.log(CurAudio);
CurAudio.play();
}
function getAudio(){
var...