Home > Web Front-end > JS Tutorial > body text

JS button to add background music implementation code

黄舟
Release: 2017-10-17 10:35:53
Original
1999 people have browsed it

This article mainly introduces the JS implementation button to add background music sample code. Friends who need it can refer to

1-Code


<html>
<head>
  <meta charset="utf-8">
  <title>js实现按键声</title>
</head>
<body>
  <ul>
    <li>
      <a href="menu-list" rel="external nofollow" rel="external nofollow" rel="external nofollow" >主页</a>
    </li>
    <li>
      <a href="menu-list" rel="external nofollow" rel="external nofollow" rel="external nofollow" >详情</a>
    </li>
    <li>
      <a href="menu-list" rel="external nofollow" rel="external nofollow" rel="external nofollow" >列表</a>
    </li>
  </ul>
  <script language="javascript">
  $(function() {
    $(&#39;menu-list&#39;).click(function() {
      $(&#39;btn-bgm&#39;).remove();
      $(&#39;body&#39;).append(&#39;<embed src="button.wav" autostart="true" hidden="true" loop="false" class = "btn-bgm">&#39;);
    });
  });
  </script>
</body>
</html>
Copy after login

 2-Description

Bind events to the node in advance, click to add background music

Summary

The above is the detailed content of JS button to add background music implementation code. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template