HTML5 Audio Player: How to select by HTML elements instead of div ID's?
问题 Making an html5 player, I'm moving away "from divs with id's" towards "simple html elements". Old Situation (works) <audio src="track1.mp3" id="audio"></audio> <controls> <play id="play" style="display:none">PLAY</button> <pause id="pause" style="display:none">PAUSE</button> <div id="progress"><div id="bar"></div></div> </controls> Javascript gets elements by divs with an id var myAudio = document.getElementById('audio'); var play = document.getElementById('play'); var pause = document