Add a control to a video element using jQuery

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

$('.video-js').attr('controls', 'controls'); 
+6
source share
1 answer

try it

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

Alternatively, if you are using jQuery 1.6+, you can / should use

  $(".video-js").prop("controls",true); 
+17
source

Source: https://habr.com/ru/post/893726/


All Articles