JSP: <div> <bgsound id="bgsound" src="" loop="false" /> </div> JS里面控制: bgsound.src = "${URL}/sound/newmsg2.mp3";