Pew Pew Laser Blog

Code. Glass art. Games. Baking. Cats. From Seattle, Washington and various sundry satellite locations.

Pew Pew Laser Blog Archives — by Blog ID

A jQuery Demo - Show, Hide and Toggle.


One of the reasons that jQuery is so popular is that it's so simple. Just click hide, show or toggle visibility to change the image below. Here's the only code required:

<img id="kitten" src="" />
<a href="#" id="hide">hide</a>, <a href="#" id="show">show</a> or <a href="#" id="toggle">toggle visibility</a>

  <script type="text/javascript">

	$("a#show").click(function() {

	$("a#hide").click(function() {

	$("a#toggle").click(function() {


Need more options? Bam - jQuery has got ya covered!


Tags: code javascript jquery web-development

Authorized users may log-in to leave a comment.

Last Blog: Awesome Keyboard Shortcuts.

Next Blog: Advice for Job Seekers.