<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> </style> </head> <body> <input id=2 type="button" value="打开音乐" onclick="a()" style="border=0 " > <BGSOUND id=1 balance=0 src="http://blog.163.com/chudaozhe@126/blog/lantingxu.mp3" loop=infinite> </body> <script language="Javascript"> function a() { if(document.getElementById(2).value=="打开音乐") { document.getElementById(1).src="http://www.qunaerwan.com/skin/shtd/21.mp3"; document.getElementById(2).value="关闭音乐";} else { document.getElementById(1).src="http://www.qunaerwan.com/skin/shtd/21.mp3"; document.getElementById(2).value="打开音乐" ;} } </script> </html>