Add attribute to embed tag using jquery

Posted by Rob on Stack Overflow See other posts from Stack Overflow or by Rob
Published on 2010-05-11T22:45:38Z Indexed on 2010/05/11 23:14 UTC
Read the original article Hit count: 404

Filed under:
|
|
|
|

I have the following embed tag:

<embed type="application/x-shockwave-flash" width="640" height="505" src="url_to_video" allowscriptaccess="always" allowfullscreen="true"></embed>

I have about five of theses on a page, and I'd like to add the attribute wmode="opaque" to all of them. However, I tried to do it like this and it didnt' work:

$j("embed").attr('wmode','opaque');

Is there another way I can dynamically set the attribute wmode="opaque" ?

Thanks!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about attribute