- Posts: 14
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<p>Stimmt das, was da gesagt wird?</p> <audio id="myAudio" preload="auto" src="/upload/surveys/725915/images/horse.mp3"> </audio> <button id="mybutton" type="button">Play Audio</button><script type="text/javascript" charset="utf-8"> $(document).ready(function() { var button = document.getElementById('mybutton'), audio = document.getElementById('myAudio'), times_played=0, max_plays=1; button.addEventListener('click',function(){ if(times_played == max_plays){ document.getElementById('mybutton').style.visibility = "hidden"; } audio.play(); times_played++; }); }); </script>