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

  • Home
  • SEARCH
  • 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 6959521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:16:58+00:00 2026-05-27T15:16:58+00:00

I am attempting to write a page with multiple <audio> tags in it and

  • 0

I am attempting to write a page with multiple <audio> tags in it and the page load takes forever (I have around 30 audio clips). A solution I saw was to leave the src="" empty and then dynamically populate when you click on a link…

http://dev.opera.com/articles/view/everything-you-need-to-know-about-html5-video-and-audio/

My snytax is wrong, but it has to do 2 things when the button is clicked. It has to load the video by populating the src and then playing the clip. I thought the following code would work:

document.getElementById('1')[0].src = '1.aif';.play()
  • 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-27T15:16:59+00:00Added an answer on May 27, 2026 at 3:16 pm

    Statements are executed separately, so .play() doesn’t execute on the element. It’s invalid, since a statement cannot start with ..

    What you seem to want is “chaining style” (execute several things elegantly in one statement), which jQuery enables you to use:

    $("#1").attr("src", "1.aif").play();
    

    Or in pure JavaScript:

    var elem = document.getElementById('1'); // returns one element, not an array
    elem.src = '1.aif';
    elem.play();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the code below, I'm attempting to write a generic function which takes
I have been attempting to write some routines to read RSS and ATOM feeds
I am attempting a one page design using loads of jQuery. I have a
I'm attempting to write a page that allows a user to remain logged in.
I am attempting to write a firefox addon that will analyze the displayed page
I've been attempting to write a Lisp macro that would perfom the equivalent of
I am attempting to write an application that uses libCurl to post soap requests
I'm attempting to write a Python C extension that reads packed binary data (it
I am attempting to write a one-line Perl script that will toggle a line
I am attempting to write a component in C# to be consumed by classic

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.