Edited my code, sorry for that!
I made a button using HTML, CSS and Javascript and I'd like to know to hide it when clicked.
Here's the HTML, it's supposed to play music when you click on play.
<audio id="myTune" src="http://www.rachelgallen.com/HappyBirthday.mp3"></audio>
<button type="button" onclick="aud_play_pause()">►</button>
CSS
body { background: black; }
button {
background: rgba(255,255,255,0.8);
border: 0;
padding: 10px 25px;
border-radius: 10px;
font-size: 20px;
font-weight: bold;
box-shadow: 0 5px gray;
outline: none;
cursor: pointer;
}
button:active {
background: #DDDDDD;
color: #222222;
border-bottom: 0;
box-shadow: 0 3px #555555;
margin-top: 2px;
}
Javascript
function aud_play_pause() {
var myAudio = document.getElementById("myTune");
if (myAudio.paused) {
myAudio.play();
} else {
myAudio.pause();
}
}
aud_play_pause()function?document.getElementById("myTune")? Where's your attempt at hiding the button?