开发者

jQuery reference <object>

开发者 https://www.devze.com 2023-03-10 05:31 出处:网络
I\'m having trouble trouble referencing my <object> This is what I have : <div id=\"videoHolder1\" style=\"display: none;\">

I'm having trouble trouble referencing my <object>

This is what I have :

<div id="videoHolder1" style="display: none;">
  <object id="video1" data="http://vimeo.com/..." type="application/x-shockwave-flash">
    <param name="data" value="http://vimeo.com/..." />
    <p开发者_StackOverflowaram name="src" value="http://vimeo.com/..." />
    <param name="wmode" value="opaque" />
    <param name="allowscriptaccess" value="always" />
  </object>
</div>

I've tried these :

alert($(".video1 embed").attr('src') );        // undefined 
alert($("#video1").attr('src') );              // undefined
alert( $("#video1" ).get(0).attr('src') );     // undefined


Do you want the value of the <param> element with name="src"?

// /-------------- Select tag with id=video1
// |       /------ Select child param tag
// |       |    /- Filter to tags with a "name" attribute with value "src"  
// |       |    |  
$("#video1 param[name=src]").attr("value") // return value of "value" attribute
0

精彩评论

暂无评论...
验证码 换一张
取 消