For sound when something is pressed:
<script>
function backspin(url) {
var ourAudio = document.createElement('audio'); // Create a audio element using the DOM
ourAudio.style.display = "none"; // Hide the audio element
ourAudio.src = "
https://cdefgahc.com/wav/front.wav"; // Set resource to our URL
ourAudio.autoplay = true; // Automatically play sound
ourAudio.onended = function() {
this.remove(); // Remove when played.
};
document.body.appendChild(ourAudio);
}
</script>
For PHP file and with no<script></script> for CUSTOM JavaScript if you have.
And I use onclick for that:
backspin();
#JavaScript #onclick #sound
For sound when something is pressed:
<script>
function backspin(url) {
var ourAudio = document.createElement('audio'); // Create a audio element using the DOM
ourAudio.style.display = "none"; // Hide the audio element
ourAudio.src = "https://cdefgahc.com/wav/front.wav"; // Set resource to our URL
ourAudio.autoplay = true; // Automatically play sound
ourAudio.onended = function() {
this.remove(); // Remove when played.
};
document.body.appendChild(ourAudio);
}
</script>
For PHP file and with no<script></script> for CUSTOM JavaScript if you have.
And I use onclick for that:
backspin();
#JavaScript #onclick #sound