<audio src>

How can I set the WAV data in <audio>tag?

<audio oncontextmenu="return false" src="file_name.wav" preload="none" controls></audio>

It is not supported now on html5.

But

<audio oncontextmenu="return false" src="file_name.mp3" preload="none" cotrols></audio><br>

is suported on html5 now.

Why the <audio>tag is moved as conpresscondence only?

Someone,Teach me.

Answered by Grandcross in 142638022

<script>

window.addEventListener('load',

function(event){

var a = document.getElementById("audio_1");

a.play();

}, false);

</script>


That is fall to syntax error.

This command is sure.

<!DOCTYPE html>

<html lang="ja">

<head>

<meta charset="utf-8">

<meta http-equiv="Content-Type" content="text/html">

<meta http-equiv="Content-Style-Type" content="text/css">

<meta http-equiv="Content-Script-Type" content="text/javascript">

<title>sample</title>

<script type="text/javascript">

window.addEventListener('load',

function(event){

var a = document.getElementById("audio_1");

a.play();

</script>

<style type="text/css">

body { background-color: #000000; text-align: center; }

div.wrapper { poasition: relative; background-color: #ff00ff; margin: 100px; }

div.header { float: left; background: radial-gradient(circle,#99ffff,#000000); margin: 10px; paddinng 10px; width: 240px; }

p1 { color: #ffff00; font-size: 25px; text-shadow: 1px 1px 1px #000080; }

p1:hover { color: #000000; font-size: 27px; text-shadow: 1px 1px 1px #ffff00; background-color: #ffff00; }

div.footer { clear: both; background-color: #008000; color: #000000; font-size: 30px; margin: 20px; }

</style>

</head>

<div class="wrapper">

<a href="index.html" target="_self"><div class="header">to the index page</div></a><br />

<div class="header"><audio id="audio_1" oncontextmenu="return false" preload="none" controls/>audio wav playing

<source src="url.wav" type="audio/wav"></audio>

</div>

<div class="footer">Copyright (p)2016Grandcross.info site, All right reserved.</div>

</div>

</body>

</html>


It's a sample page writing.

Accepted Answer

<script>

window.addEventListener('load',

function(event){

var a = document.getElementById("audio_1");

a.play();

}, false);

</script>


That is fall to syntax error.

This command is sure.

window.addEventListener('load',

function(event){

var a = document.getElementById("audio_1");

a.play();

}

,false);

&lt;audio src&gt;
 
 
Q