Hello,
I'm looking for some help on how to add a sound effect to my current
javascript. I'm using a simple array of quotes to generate a new quote
each time a button is clicked. I'd like to also have an audio clip of
the quote to play in accordance with the text of the quote being
displayed. I'm a noob so I have no idea how to accomplish this. Any
help is greatly appreciated!
Here's the basic structure of what I'm using now.
var pullQuote = new Array(5);
var randomNumber = Math.floor(Math.random() * 5);
pullQuote[ 0] = "I like Internet Scripting, but it is very hard and
sometimes makes my brain hurt!";
pullQuote[ 1] = "Internet Scripting is the best course in the DMT
program!";
pullQuote[ 2] = "Learning JavaScript will help me become a better web
designer!";
pullQuote[ 3] = "I think JavaScript is for the monkeys!";
pullQuote[ 4] = "JavaScript makes me go loopy!";
var quote = document.getElementById('quote');
quote.innerHTML = (pullQuote[randomNumber]);
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]