Jquery如何获取 embed元素

JavaScript012

Jquery如何获取 embed元素,第1张

可以获取啊,$("embed"),我测试了是可以的,如果要获得属性,可以用$("embed").attr("id")这样的,id可以换成你要的属性名

index.htm

----------------------------------------------------------------

<!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">

<head>

<title></title>

<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript" src="JScript.js"></script>

</head>

<body>

<embed src="test.mp3" align="A" width="500" height="400" autostart="true" loop="true"></embed>

</body>

</html>

JScript.js

----------------------------------------------------------

$(document).ready(function() {

alert($("embed").length)

}

代码如下:

<html>

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=windows-31j">

<title>Insert title here</title>

<script type="text/javascript">

function load() {

var embedTag = document.createElement('embed')

embedTag.type = "image/svg+xml"

embedTag.width = "640"

embedTag.height = "480"

embedTag.onload = function() {

alert(embedTag.getSVGDocument())

}

embedTag.src = "test.svg"

document.body.appendChild(embedTag)

}

</script>

</head>

<body onload="load()">

</body>

</html>

http://blog.csdn.net/tsubasadakong/article/details/377617651、在HTML中,使用JavaScript嵌�….swf文件(test.swf),并且赋予id,name(比如 swfobj) <embed src='test.swf' width='500px' height='500px' id='swfobj' name='swfobj'></embed>2、获取当前播放帧数:var currentFrame= swfobj.CurrentFrame() 获 取总 帧 数:var totalFrames=swfobj.TotalFrames()3、如果要在swf播放完后移除它,在定时器中监听时,判断条件 swfobj.CurrentFrame()>=swfobj.TotalFrames()-1(或者==,感觉>=更加保险 鄙视) 是否为true。 CurrentFrame的最大值为总帧数-1