Mark
Mark

Reputation: 33651

Javascript playing a video - what am i doing wrong?

I think the code is self-explanatory, the button doesn't work, what am I doing wrong?

Using Chrome.

http://jsbin.com/ugoni3/edit

Upvotes: 2

Views: 1759

Answers (1)

user180100
user180100

Reputation:

Your code gives:

Uncaught TypeError: Object # has no method 'play'

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

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

Upvotes: 3

Related Questions