<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>seclectmusic.html</title>

    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
  
   <script type="text/javascript">
   //定义更改背景音乐的函数
  function my_sound(obj)
     {
      alert("1");
      if(obj.options[obj.selectedIndex].value=='1'){
      alert("2");
      var n=document.getElementById("f");
             n.src="1.pm3";
      n.autoplay=true;
      n.play();
     
          
      }
      if(obj.options[obj.selectedIndex].value=='2'){
      alert("3");
      var m = document.getElementsByName("s");
      m.src = "2.mp3";
      m.play();
      }
      if(obj.options[obj.selectedIndex].value=='0'){
      var m = document.getElementsByName("music2");
      m.src = "";
      m.stop();
      }
        
    }
    </script>
  </head>
  
  
    <body >
<!--<embed src="1.mp3" type="application/x-mplayer2" autostart="true" playcount="true" loop="true" height="0" width="0">   -->
<embed  id="f" src="1.mp3" loop="-1" autoplay="false"  hidden="true"  type="application/x-mplayer2">
<embed  id="s" src="2.mp3" loop="-1" autostart="false" autoplay="false" hidden="true"  type="application/x-mplayer2">
<form >
  <select onchange="my_sound(this)" > 
 <!-- <option value="0" selected="selected">------无------</option>  --> 
  <option value="1" selected="selected">曲目1</option>
  <option value="2" >曲目2</option>
  </select>
</form>
</body>
</html>