How to fetch id of video from embed code?
I have two div I want to fetch the video id from embed tag of (div id="main)) through JavaScript. After that I want to replace that id with the embed code of (div container).
<div id ="container">
<object width="550" height="550">
<param value="http://www.youtube.com/v/sIFYPQjYhv8&rel=0&color1=0x2b405b&color2=0x6b8ab6&border=1" name="movie">
<param value="transparent" name="wmode">
<embed width="550" height="550" wmode="transparent" type="application/x-shockwave-flash" src="http://www.youtube.com/v/sIFYPQjYhv8&rel=0&color1=0x2b405b&color2=0x6b8ab6&border=1">
</object>
< /div>
<div id="main">
<a id="displayText">
<object width="150" height="150">
<param value="http://www.youtube.com/v/sIFYPQjYhv8&rel=0&color1=0x2b405b&color2=0x6b8ab6&border=1" name="movie">
<param value="transparent" name="wmode">
<embed width="150" height="150" wmode="transparent" type="application/x-shockwave-flash" src="http://www.youtube.com/v/sIFYPQjYhv8&rel=0&color1=0x2b405b&color2=0x6b8ab6&border=1"><开发者_开发技巧;/object>
</a>
</div>
Actually I have 5 video in <div id="main">
when I click on any then that viedo should be play <div id ="container">
.
try:
x = document.getElementByTag('div');
if (x.id == 'main')
{
do whatever
}
Ok...
x = document.getElementByTag('param')
if (x.name=='movie')
{
name = x.value;
}
精彩评论