Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add controls attribute to video element using jQuery

Tags:

jquery

I am trying to figure out how to add controls to a video using jQuery.
I have tried the following but it did not work:

$('.video-js').attr('controls', 'controls');
like image 525
Chris Abrams Avatar asked Jul 27 '11 22:07

Chris Abrams


1 Answers

Try this

$('.video-js').attr('controls',true);

Alternatively if you're using jQuery 1.6+ you may/should use

 $(".video-js").prop("controls",true); 
like image 168
Tomm Avatar answered Nov 15 '22 17:11

Tomm