• Hi,

    I am trying to play a sound using javascript when the viewer clicks a link.

    <a href="playBang();" onClick="playBang();">bang</a>

    I have the playBang(); function working fine, if I run it as javascript:playBang(); in the browser url bar, it works fine.

    I have tried putting the js in both (and separately) the href and onClick of the link.
    href="..." gets reformatted to href="javascript:void(0)" and onclick="..." is reformated to onclick.
    I’ve tried over an hour to get this to work and have searched the internet, am I doing something wrong? Thank you!

    [ Please do not bump, it’s not permitted here. ]

  • The topic ‘onClick for text link’ is closed to new replies.