Javascript is playing video - what am I doing wrong?

I think the code is self-explanatory, the button is not working, what am I doing wrong?

Using Chrome.

http://jsbin.com/ugoni3/edit

+2


a source to share


1 answer


In your code:

Uncaught TypeError: object # has no 'play' method



Note the get () below to get the DOM object:

$(function () {
  $('input').click(function () {
    $('video').get(0).play();
  });
});​

      

+4


a source







All Articles