I have created a fiddle of my function here( http://jsfiddle.net/rhy5K/10/ ) . Now i want to disable the button click i.e play/pause
if the sound is playing like Get ready,5,4,3,2,1
.
I know only how to disable the form submit button , but I am very confused how to disable the click in my case the hyperlinks
.
Explanation using code example:
I want to disable this
<a href="#" id="btn_start">PLAY</a>
click, while interpreter is executing the below code:
var playGetReady = function (done) {
var ids = ['audiosource', 'a_5', 'a_4', 'a_3', 'a_2', 'a_1'],
playNext = function () {
var id = ids.shift();
document.getElementById(id).play();
if (ids.length) {
setTimeout(playNext, 1000);
} else {
done();
}
};
playNext();
};
Warning: This JS fiddle demo may play sound on load