Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to play background sound js

<script>
  function play() {
  var audio = new Audio('https://interactive-examples.mdn.mozilla.net/media/examples/t-rex-roar.mp3');
  audio. play();
  }
</script>
<button onclick-"play();">PLAY MY AUDIO</button>
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to convert name to initials in javascript 
Javascript :: javascript change background color setinterval 
Javascript :: copy text to clipboard reactjs 
Javascript :: bubble sort js 
Javascript :: mongodb push to index 
Javascript :: stream recording javascript 
Javascript :: angular call child method from parent 
Javascript :: hover material ui styles 
Javascript :: javascript fs write file with folder 
Javascript :: javascript sort array of objects 
Javascript :: react leaflet recenter map 
Javascript :: javascript how to select radio button 
Javascript :: If statement discord js 
Javascript :: react render component after fetch 
Javascript :: javascript html append 
Javascript :: angular redirect to external url 
Javascript :: react blur background 
Javascript :: mapgetters with parameter 
Javascript :: ngrok live port vue js 
Javascript :: useeffect dependency error 
Javascript :: how to export a constant in javascript 
Javascript :: javascript move element to coordinates 
Javascript :: jshint ignore 
Javascript :: how to remove quotes using regex 
Javascript :: discordjs v13 get message content 
Javascript :: generate apk debug react native 
Javascript :: adding background video angular 6 
Javascript :: javascript push dictionary into array 
Javascript :: getmilliseconds javascript 
Javascript :: angular router outlet 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =