2 Replies - 256 Views - Last Post: 19 September 2017 - 11:28 PM

#1 Reivaxor  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 13-September 17

how to play audio only when i click Play button

Posted 19 September 2017 - 01:36 PM

hi,how to show/play audio when i press my custom play button, i tried the code below but my button did not show anything when click.
i tried grabbing the Ids, but I can't seem to get the names of audio files.

<span>Play</span> <a href="myAudio">
         <audio id="myAudio" controls autoplay>
      <source src="horse.ogg" type="audio/ogg">
    </audio>


Is This A Good Question/Topic? 0
  • +

Replies To: how to play audio only when i click Play button

#2 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3714
  • Posts: 13,467
  • Joined: 08-August 08

Re: how to play audio only when i click Play button

Posted 19 September 2017 - 08:29 PM

Have you tested the code here? Note that they have the file "horse.ogg" on their server.

curl https://www.w3school.../html/horse.ogg > horse.ogg
downloaded it to my system.
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is offline

  • the case is sol-ved
  • member icon

Reputation: 6374
  • View blog
  • Posts: 25,755
  • Joined: 12-December 12

Re: how to play audio only when i click Play button

Posted 19 September 2017 - 11:28 PM

Your a tag is unclosed and should not surround the audio tag (unless you have some specific reason to attempt this?).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1