Add controls attribute to video element using jQuery

Home Forums Javascript Add controls attribute to video element using jQuery

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2702
    Techy Online
    Keymaster

    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');
    #2706
    Techy Online
    Keymaster
    
    $('.video-js').attr('controls',true);
    
    Alternatively if you're using jQuery 1.6+ you may/should use
    
    $(".video-js").prop("controls",true);

    Best Answer

    • This reply was modified 4 years, 8 months ago by Techy Online.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.