View Full Version : onClick
I am sorry to waste someone's time, but I am new to javascript. How would I go about changing an image and playing a sound in an onClick function?
Any input is greatly appreciated.
With just a little research im sure you could figure out what you need. If you wanted to change an image you could do it easily like such:
<img src="whatever.jpg" name="theimage">
onClick="window.document.theimage.src='newimagesrc.jpg'"
just put the filename of the new image and the old image will change to that.
As far as playing a sound im not sure how u would do so without opening a media player of some sort which the person may not have.
I'm not sure this is what you were looking for but if so it should help.
vBulletin® v3.6.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.