A basic default example with a click event.
var sound0 = new JsSound('id', 'click', ['sound/crash1.wav', 'sound/crash1.mp3']);
An example using multiple targets with the same class.
Sound on class - click me Sound on class - click me Sound on class - click me
var sound1 = new JsSound('class', 'clank', ['sound/clank.wav', 'sound/clank.mp3']);
An example using the optional fourth parameter, which specifies what type of event to listen for, rather than the default click action.
var sound2 = new JsSound('id', 'box', ['sound/crash1.wav', 'sound/crash.mp3'], 'mouseover');
var sound3 = new JsSound('id', 'box', ['sound/clank.wav', 'sound/clank.mp3'], 'mouseout');
JsSound on the third parameter accepts either an array of files to use ( each of these should be of the same sound but different formats, in order to provide a wider range of browser matches). This example shows a string being used.
var sound4 = new JsSound('id', 'single', ['sound/clank.wav', 'sound/clank.mp3']);