Toggle text change on click

Discussion in 'JavaScript' started by jijihuqw, Jul 13, 2011.

  1. #1
    Hey there, I have a Dynamic Collapsing Box which is toggled by

    <div align="right" style="padding-right:25px"><a href="javascript:animatedcollapse.toggle('test1')" >Hide this deal</a></div>

    I was wondering how I could make it so that when people click on hide, it changes the text to " Show this deal " and then back to Hide when they click show.

    Cheers
     
    jijihuqw, Jul 13, 2011 IP
  2. BRUm

    BRUm Well-Known Member

    Messages:
    3,086
    Likes Received:
    61
    Best Answers:
    1
    Trophy Points:
    100
    #2
    Use DOM manipulation of the hyperlink tag's "innerHTML" property upon "onclick".
     
    Last edited: Jul 14, 2011
    BRUm, Jul 14, 2011 IP