htmlcsscoding htmlcsscoding - 1 year ago 70
Javascript Question

Can someone show me how to add this code to the rest of the code

My Code:

This is the code, I don't know how to add it to the rest of the code, can someone show me?


<button style="cursor: pointer; background-color:blue;padding-bottom:1px;"

<audio id="player" preload="none" style="display:none;">
<source src='' type='audio/mpeg'/>

Answer Source

Add one function() on onclick. Set volume and play controls inside that function.

Additional Changes: Added controls in audio tag to display HTML5 controls and removed display:none

Edit: You can add setControls() function inside <script> </script> tag. You can also add script in external file and link it. Please read more

function setControls() {
<button style="cursor: pointer; background-color:blue;padding-bottom:1px;"

<audio controls id="player" preload="none">
<source src='' type='audio/mpeg'/>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download