How do I make descriptive text disappear when audio is done playing? | XM Community
Skip to main content
I have descriptive text saying "Please press play.", and an audio file under it. I already have it so that the audio player disappears after it is done playing, using

jQuery('audio').on('ended', function() { jQuery(this).hide(); });

but I would like it so that the text disappears at the same time as the audio player.
Use the below code:



var that = this;

jQuery('audio').on('ended', function() {

jQuery(this).hide();

jQuery("#"+that.questionId+" .QuestionText").hide();

});



Leave a Reply