views:

60

answers:

1

i got videos list using AJAX, and me want to play a top video an a light box? so after viewing list how it is possible to play video automaticaly?

+1  A: 

html code

<a id="a_lnk" href="http:\\www.cnn.com">cnn</a>​

javascript code

// find a <a> element with id a_lnk
var lnk = document.getElementById('a_lnk');
lnk.onclick = function(e){
  // do the magic here..
  // e.target is the object that got the click
    window.location = e.target.getAttribute('href');
  return false;
}​

complete example here

http://jsfiddle.net/eAFWY/26/

can also be done with jQuery if that is your thing

http://api.jquery.com/click/

Aaron Saunders
not working....
Aamir
@Aamir added complete working example
Aaron Saunders