Answers for "how to change icon from play to pause in javascript"

0

how to change icon from play to pause in javascript

<script>
    function toggleSound() {
       var audioElem = document.getElementById('player');
       if (audioElem.paused) {
          audioElem.className = "fa fa-play";
          audioElem.play();
       } else {
          audioElem.className = "fa fa-pause";
          audioElem.pause();
       }
    }
</script>
Posted by: Guest on June-05-2021

Code answers related to "how to change icon from play to pause in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language