JSFiddle - React, Tailwind, and code Playground

by shapeshifta

HTML

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css">
<button id="test">Hi there!</button>

JavaScript

var context;
if (typeof AudioContext !== "undefined") {
    context = new AudioContext();
} else if (typeof webkitAudioContext !== "undefined") {
    context = new webkitAudioContext();
} else {
    throw new Error('AudioContext not supported. :(');
}


$('#test').on('click', function (e) {
    $(this).effect("pulsate", {
        times: 3
    }, 2000);

    var oscillator = context.createOscillator();

    oscillator.type = 0; // sine wave
    oscillator.frequency.value = 2000;
    oscillator.connect(context.destination);
    oscillator.noteOn && oscillator.noteOn(0);
});