Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: send variable to javascript promise 
Javascript :: js concatenate regex 
Javascript :: button change slider value js 
Javascript :: jasmine sample code 
Javascript :: javascript button click event 
Javascript :: fetch api 
Javascript :: document.getelementbyid 
Javascript :: jquery api 
Javascript :: discord js v12 get user tag with id 
Javascript :: javascript get tag child elements 
Javascript :: js add html element 
Javascript :: ref in functional components 
Javascript :: read json file into array javascript 
Javascript :: dynamic search bar javascript 
Javascript :: json parse cause Unexpected token in JSON at position 550 
Javascript :: comparing two array of objects in javascript returning differences 
Javascript :: how to pass a prop in route 
Javascript :: getting values for metaboxes in wordpress 
Javascript :: javascript new date invalid date dd/mm/yyyy 
Javascript :: prev props 
Javascript :: chart.js clear data 
Javascript :: js stop submit 
Javascript :: check if every value in array is equal 
Javascript :: carousel react 
Javascript :: chrome storage sync example 
Javascript :: opencage reverse geocoding example 
Javascript :: postgres boolean column 
Javascript :: vue electron name and icon 
Javascript :: functional component state management 
Javascript :: react chat sheet 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =