javascript - How to fetch id of video from embed code -
i have 2 div want fetch video id embed tag of(div id="main)) through javascript.after want replace id 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 have 5 video in <div id="main">
when click on viedo should play <div id ="container">
please shall thankful shalu
try:
x = document.getelementbytag('div');
if (x.id == 'main')
{
do whatever
}
ok...
x = document.getelementbytag('param')
if (x.name=='movie')
{
name = x.value;
}
Comments
Post a Comment