You can add HTML background music code to your website by using the element, but omitting the controls attribute. The controls attribute specifies that there should be controls (such as a "Play" button, "Pause" button etc) so by removing this attribute, no controls will be displayed. You can test this using the example below. The example currently contains the control attribute. Try replacing that attribute with autoplay, then clicking "Update". If you can't see the above example, your browser may not yet support the element (this element was introduced in HTML5). For browsers that don't support this element, you can nest the element inside the element. By doing this, incompatible browsers will ignore the element and go straight to the element. Although this element was also only introduced in HTML5, it has been around for a long time (but just not part of the official HTML specification), and it has widespread support among browsers.
If you are reading this, it is because your browser does not support the audio element.
Attributes for the Element :
The element supports a number of attributes - both global and local. To see a list of these, along with a description, visit the HTML5 tag page.
Using the tag :
You can also add HTML background music code to your web page using the hidden attribute of the tag. Again, you might like to nest this tag inside the tag for maximum browser compatibility. To do this, see HTML Music Code.
Example Background Music Code :
This code will run music in the background as soon as the page loads.
Adding Audio Controls :
When using the element, if you want your users to be able to control whether the background music plays or not, you can simply remove the hidden attribute (or change it to "false"). You can also add width and height to the controls. It's also a good idea to turn autostart off.
Download : background music script