<script type/javascript>
function al(){
var qq = document.getElementById("s)
qq.setAttribut("autostart","true)这里修改不了autostart属性? 求改正
}
</script>
4 个解决方案
#1
window.onload=function(){
var qq = document.getElementById("s");
qq.setAttribute("autostart","true");
};
</script>
<style type="text/css">
</style>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
</body>
</html>
#2
还是不行
#3
改为true是不是要播放?是的话用下面代码看看 , 要播放一般是用 paly()方法
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>3</title>
<script type="text/javascript">
function c(){
var qq = document.getElementById("s");
qq.play();
};
</script>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
<input type="button" value="点击播放" onClick="c()"/>
</body>
</html>
#4
window.onload=function(){
var qq = document.getElementById("s");
qq.setAttribute("autostart","true");
};
</script>
<style type="text/css">
</style>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
</body>
</html>
还是不行
改为true是不是要播放?是的话用下面代码看看 , 要播放一般是用 paly()方法
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>3</title>
<script type="text/javascript">
function c(){
var qq = document.getElementById("s");
qq.play();
};
</script>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
<input type="button" value="点击播放" onClick="c()"/>
</body>
</html>
不用点击事件,本来音乐是不要响的,我是根据条件判断他什么时候该响,我就用JS修改 <embed>的autostart为true,他就响就行了,浏览器是IE8
#1
window.onload=function(){
var qq = document.getElementById("s");
qq.setAttribute("autostart","true");
};
</script>
<style type="text/css">
</style>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
</body>
</html>
#2
window.onload=function(){
var qq = document.getElementById("s");
qq.setAttribute("autostart","true");
};
</script>
<style type="text/css">
</style>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
</body>
</html>
还是不行
#3
window.onload=function(){
var qq = document.getElementById("s");
qq.setAttribute("autostart","true");
};
</script>
<style type="text/css">
</style>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
</body>
</html>
还是不行
改为true是不是要播放?是的话用下面代码看看 , 要播放一般是用 paly()方法
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>3</title>
<script type="text/javascript">
function c(){
var qq = document.getElementById("s");
qq.play();
};
</script>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
<input type="button" value="点击播放" onClick="c()"/>
</body>
</html>
#4
window.onload=function(){
var qq = document.getElementById("s");
qq.setAttribute("autostart","true");
};
</script>
<style type="text/css">
</style>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
</body>
</html>
还是不行
改为true是不是要播放?是的话用下面代码看看 , 要播放一般是用 paly()方法
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>3</title>
<script type="text/javascript">
function c(){
var qq = document.getElementById("s");
qq.play();
};
</script>
</head>
<body>
<embed id="s" src="aa.wav" loop="true" hideen="true" autostart="false" ></embed>
<input type="button" value="点击播放" onClick="c()"/>
</body>
</html>
不用点击事件,本来音乐是不要响的,我是根据条件判断他什么时候该响,我就用JS修改 <embed>的autostart为true,他就响就行了,浏览器是IE8