www.webdeveloper.com
Results 1 to 2 of 2

Thread: Is this possible?

  1. #1
    Join Date
    Oct 2011
    Location
    Hamilton, Ontario
    Posts
    76

    Lightbulb Is this possible?

    so if I use a bunch of embed html tags to make it so that a certain sound file plays when a certain link is clicked, is there a way to use javascript to make the "src" attribute for that embed file change depending on which of several different links is clicked (they are internal links)?

  2. #2
    Join Date
    Jul 2012
    Location
    Vancouver
    Posts
    61
    your_embed = document.getElementById('embed_id');
    your_embed.setAttribute('src','your_new_src.whatever');


    or with jquery..
    $("#your_embed_id").attr("src","your_new_src");

    both should work

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles