I have a page where I display some audios when the user clicks and fires the sound.
ExampleHTML
<td><spanclass="audiospeak" data-lang="en" data-aid="of">of</span></td>
<td><span class="audiospeak" data-lang="en" data-aid="and">and</span></td>
Now I need to implement a button to play all the sounds on the page within 5 seconds.
I tried the following code
jQuery(function($){
var interval1;
setTimeout(function(){
interval1 = setInterval(function()
{
$('.audiospeak').trigger('click');
},
5000);
},
5000);
})
But it is firing all at the same time, where can I be wrong?