Solution 1 :

I think you might need to add the controls attribute to your <audio> tag. That way you don’t need the extra button(s).

It would look like this:

<div class="buttons">
    <audio id="myaudio" controls>
        <source src="media/tasmanian-devil-daniel_simon.mp3" preload="auto">

Solution 2 :

Method 1 – with default control
Answer by Niels Bosman

Method 2 – with custom button

-- JS  
const myaudioInput = document.querySelector('#myaudio');

function playAudio() {;

-- HTML  
<i class="fa fa-play" onclick="playAudio()"></i>

to pause


to restart

myaudioInput.currentTime = 0;;

Problem :

I am struggling to make the play icon active and play a sound. Can anyone help me?

Here is my HTML:

<div class="buttons">
    <a id="play" href="#" class="btn">
        <audio id="myaudio">
            <source src="media/tasmanian-devil-daniel_simon.mp3" preload="auto"  > 
        <i class="fas fa-play"></i>


Comment posted by Bilyana Karamfilova

I need some javascript help. 🙂

Comment posted by ROOT

its probably the URL for the audio is not right can you check the network tab in your dev tool?

Comment posted by Rob

I don’t see any javascript you have used.

Comment posted by

Hey, yes, but i just want to have a tine play icon –