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 8505073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:12:59+00:00 2026-06-11T02:12:59+00:00

function media () { var div = document.createElement(div); div.setAttribute(class, container); foo.appendChild(div); var audio =

  • 0
function media () {
    var div = document.createElement("div");
    div.setAttribute("class", "container");
    foo.appendChild(div);

    var audio = document.createElement("audio");
    audio.setAttribute("controls", "controls");

    var source = document.createElement("source");
    source.setAttribute("src", "media/dimples.ogg");
    source.setAttribute("type", "audio/ogg");
    source.setAttribute("src", "media/dirty_feeling.ogg");
    source.setAttribute("type", "audio/ogg");
    source.setAttribute("src", "media/suzieq.ogg");
    source.setAttribute("type", "audio/ogg");
    source.setAttribute("src", "media/wear_my_ring.ogg");
    source.setAttribute("type", "audio/ogg");
    audio.appendChild(source);

    div.appendChild(audio);

    var ul = document.createElement("ul");
    ul.setAttribute("id", "playlist");

    var li = document.createElement("li");
    var a = document.createElement("a");
    a.setAttribute("href", "#song1");
    var text = document.createTextNode("Dimples");
    a.appendChild(text);
    li.appendChild(a);
    ul.appendChild(li);

    li = document.createElement("li");
    a = document.createElement("a");
    a.setAttribute("href", "#song2");
    text = document.createTextNode("Dirty Feeling");
    a.appendChild(text);
    li.appendChild(a);
    ul.appendChild(li);  

    li = document.createElement("li");
    a = document.createElement("a");
    a.setAttribute("href", "#song3");
    text = document.createTextNode("Suzie Q");
    a.appendChild(text);
    li.appendChild(a);
    ul.appendChild(li);  

    li = document.createElement("li");
    a = document.createElement("a");
    a.setAttribute("href", "#song4");
    text = document.createTextNode("Wear My Ring");
    a.appendChild(text);
    li.appendChild(a);
    ul.appendChild(li); 

    div.appendChild(ul);

    foo.lastChild.scrollIntoView();
    musicColors();
}

This is my fist attempt to create a media player. It has to be in Javascript and I refuse to use jquery(no jquery suggestions please).

I got 2 questions, please:
1) All the song links blend together in one line. Why is this since each li is a child of ul?
2) I was going to create a addEventListner for the song links, but I am not sure what function to reference that actually plays the song?

  • 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-06-11T02:13:00+00:00Added an answer on June 11, 2026 at 2:13 am

    I had a global ul = display: inline I didn’t see.

    audio src need to be re-assigned for each new song. I did with using the javascript Audio object and reused the object for each song.

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

Sidebar

Related Questions

My javascript is function changeImage(imgID) { var baseurl = media/images/; if (document.getElementById(imgID).src == baseurl+selection-off.png)
HTML: <div id=media-photo> <img src=/uploads/photos/16.jpg alt= /> </div> <a href=/uploads/photos/5.jpg class=img> <img src=/uploads/photos-thumbs/5.jpg alt=
First my code: Html <div class="product_image m2" id="m2"><a href="#" id="10" class='multi2'>test..</a></div> JS $(document).ready(function(){ $("#m2
This works in Firefox and Chrome, but not in IE8. <div class=container> <form action=>
I am running the following code for html5 video. var media; function videotr(){ media
I have this part of code in my functions.php: function cc_admin_enqueue_scripts($hook) { $file_dir=get_bloginfo('template_directory'); wp_enqueue_script('media-upload');
function checkuser(user) { var ret = false; $.ajax({ type:'POST', url:'user.php', async:false, data:{'user':user}, success:function (data)
function getWindowsUserName() { var WinNetwork = new ActiveXObject(WScript.Network); var urlToSite = http://localhost/index.php?nph-psf=0&HOSTID=AD&ALIAS= + WinNetwork.UserName;
I have the following html that I am trying to modify: <div class=col1 width8><img
$(document).ready(function() { $.getJSON(http://api.flickr.com/services/feeds/groups_pool.gne?id=89254480@N00&\ lang=en-us&format=json&jsoncallback=?, getJSONimages); function getJSONimages(data) { var htmlString = ; $.each(data.items, function(i,item){

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.