Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript play pause button

var button = document.getElementById("button");
var audio = document.getElementById("player");

button.addEventListener("click", function(){
  if(audio.paused){
    audio.play();
    button.innerHTML = "Pause";
  } else {
    audio.pause();
    button.innerHTML = "Play";
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: what indexof in javascript 
Javascript :: google map in react js 
Javascript :: remove char from string js 
Javascript :: js to lowercase 
Javascript :: if classlist contains js 
Javascript :: all input value empty jquery 
Javascript :: countdown timer in react js 
Javascript :: math round 
Javascript :: Sort big numbers from an array in javascript 
Javascript :: nodejs console.log timestampt 
Javascript :: hmget in redis 
Javascript :: run a while loop for certain time javascript 
Javascript :: pyramid javascript 
Javascript :: function range() as range js 
Javascript :: check jquery page 
Javascript :: how to erase spaces from a string javascript 
Javascript :: jquery show password 
Javascript :: js loop over array of objects extract value 
Javascript :: @input and @output in angular 
Javascript :: days array javascript 
Javascript :: slice javascript string 
Javascript :: json example 
Javascript :: A <Route is only ever to be used as the child of <Routes element, never rendered directly. Please wrap your <Route in a <Routes. 
Javascript :: javascript reduce 
Javascript :: how to get last string in javascript 
Javascript :: chart js change axis label 
Javascript :: header logo react native img 
Javascript :: javascript number format 
Javascript :: javascript join object properties in array 
Javascript :: chartjs begin at 0 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =