开发者

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&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;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&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1">
       </object>
< /div>

<div id="main">
<a id="displayText">
<object width="150" height="150">
 <param value="http://www.youtube.com/v/sIFYPQjYhv8&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;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&amp;rel=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;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;

}

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜