Hide and Show

Posted By: Ian on Mar 07, 2011 in JavaScript, Snippets

Often you want to hide or show an image or one or more tags on your page and using this reusable script you can do just that.No code to edit and it also changes (Toggles) the button value. You just have to insert 4 variables whenever you want to call the script
<input type="button" onclick="toggleItem(‘1′,this.id,’3′,’4’);" value="Show" id="bt1" />

  1. id of item to toggle (hide/show)
  2. this.id (id of button you can leave it as it is)
  3. default value of button (To match button value)
  4. Value when button is toggled
Try Me Download .rar

Download .zip

AnonymousIan.J.Gough

Did this help you? Please Let me know by commenting below even if it’s just to say “Thanks”

leave a comment

About This Site

Dreams are built from lines of code well it's true!
If you can dream it you can usually code it.

I have learned so much from other people on the Internet and this site is for me to give back some of what i have learned and hope people can now learn from me.
Have fun and surf safely,
Ian.J.Gough

protected by copyscape duplicate content check

Categories


Powered by Banner Bar 125