javascript怎样获取EMBED的src的值,并且重新赋值
展开全部
完全可以的呀!!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh" dir="ltr">
<head profile="http://www.w3.org/2000/08/w3c-synd/#">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Leo,HEnT Studio,LAMP,PHP,MySQL" />
<meta name="DEscription" content="HEnT Studio" />
<meta name="Author" content="Leo,HEnT Studio" />
<title>New Page | xHTML1.0 Transitional</title>
<link rel="shortcut icon" href="favicon.ico" />
<script>
function show ()
{
var obj = document.getElementById('m').src;
alert(obj);
}
</script>
</head>
<body>
<embed style="FILTER: Xray" src="a1.mp3" width="0" height="0" type="audio/mpeg" loop="-1" volume="0" id = 'm'></embed />
<input type = 'button' onclick = 'show()' value = 'showSRC'>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh" dir="ltr">
<head profile="http://www.w3.org/2000/08/w3c-synd/#">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Leo,HEnT Studio,LAMP,PHP,MySQL" />
<meta name="DEscription" content="HEnT Studio" />
<meta name="Author" content="Leo,HEnT Studio" />
<title>New Page | xHTML1.0 Transitional</title>
<link rel="shortcut icon" href="favicon.ico" />
<script>
function show ()
{
var obj = document.getElementById('m').src;
alert(obj);
}
</script>
</head>
<body>
<embed style="FILTER: Xray" src="a1.mp3" width="0" height="0" type="audio/mpeg" loop="-1" volume="0" id = 'm'></embed />
<input type = 'button' onclick = 'show()' value = 'showSRC'>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询