Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6469703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:01:28+00:00 2026-05-25T06:01:28+00:00

I have a few elements set up in my html with the autoplay option

  • 0

I have a few elements set up in my html with the autoplay option included. I have found that Chrome doesn’t seem particularly willing to autoplay these videos for whatever reason. I’d like to add a bit of javascript to set the video to play once it’s loaded. I understand I need to use the play() method on the DOM element in question.

I’m using:

  document.getElementsByTagName('video').play();

This code successfully autoplays my video elements. However, it also throws an error picked up in the console as

Uncaught TypeError: Object #< NodeList > has no method ‘play’

I haven’t come across this error before and it’s stopping the rest of my javascript for executing properly. Any ideas as to what this is and how to resolve it?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:01:29+00:00Added an answer on May 25, 2026 at 6:01 am

    That’s because getElementsByTagName returns an array of elements so you may specify which element in this array you want.

     document.getElementsByTagName('video')[0].play();
    

    Maybe affecting an id to the <video> element may be better, you can then retreive it by using getElementById(id).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few elements in a RelativeView with the align bottom attribute set,
I have a few select elements that are grouped by a span. I'm creating
I have a large set (around 100) of page elements that I would like
I have a few list elements, like this: <li class=item> <a class=toggle><h4>ämne<small>2010-04-17 kl 12:54
My Page is 980px in Width, but I have a few design elements (which
I have an unordered list with a few list elements. #tags { width: 300px;
I have a few elements with a click event: $$('.set_main').invoke('observe', 'click', set_main ); And
I have a table in HTML with a few rows. I originally gave some
I have a XIB file in which I have a few UI elements. The
Imagine you have a set of five elements (A-E) with some numeric values of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.