hi all i want little help guys i want to know how to done this? when we click on play player will show and and when we click on stop player will hide ? http://mp3class.com/mp3-Lady+Gaga+Applause.html thanks
Well something like this is pretty simple to make. If you look at the source code behind this site then you can see how they are doing it and you can do it the same way (don't rip the code make it yourself thou!) function musicPlay(mp3id) { var player_div = document.getElementById("player" + mp3id); var button = document.getElementById("pl" + mp3id); var url = document.getElementById("playurl" + mp3id).innerHTML; if (button.innerHTML === "Stop") { player_div.innerHTML = ""; button.innerHTML = "Play"; } else { //remove all players var elements1 = document.getElementsByClassName('player'); for (i=0; i<elements1.length; i++) elements1[i].innerHTML = ''; //set buttons var elements2 = document.getElementsByClassName('playbtn'); for (i=0; i<elements2.length; i++) elements2[i].innerHTML = 'Play'; button.innerHTML = "Stop"; player_div.innerHTML = "<audio controls autoplay><source src=\"" + url + "\" type=\"audio/mpeg\">Your browser does not support the audio element.</audio>"; } } Code (markup): Your markup is going to have to be the same or change it to match yours.