Create a button image using any technique you like. To be able to indicate visually that the button is pressed down, it has to be “raised” first.
Here are the Bevel and Emboss layer style settings I used in Photoshop to create the raised button effect for my download button.

UP button layer style
Most settings here are a matter of taste, but the important one for this effect is Direction: Up. Once you are visually pleased with the raised version of the button you’ve created, save the image in the Web format of you choosing (I personally favor png). This will be you Up button.
Now go back into the layer styles and change the Direction setting to Down.

DOWN Button layer style
As you can see, the resulting button looks as though it has been pressed down. Same as with the first image, save it in your favorite Web format. You now have both the Up and Down button images.
Now we will use simple JavaScript to handle the toggling as the button is clicked and released.
<img src=”img/button_up.png” alt=”my button” onmousedown=”this.src=’img/button_down.png’;” onmouseup=”this.src=’img/button_up.png’;” onmouseout=”this.src=’img/button_up.png’;”/>
The image source (src) is initially set to the Up version of the button. onmousedown event handler switched the src to the Down version, that’s simple enough. To get your button looking Up again takes two event handlers – onmouseup and onmouseout. The reason two are required is because a person can click the button (causing it to switch to Down) and then drag the cursor off the button instead of releasing the mouse while over the button (let’s say he changed his mind about clicking the button). Unless onmouseout sets the button to Up, the button will remain looking down, which is wrong.
appreciated very much, I have to announce that your website is brilliant!
Comment by Torri Suchy — April 2, 2010 @ 7:35 pm
Thankyou, I never new this, thankyou.
Comment by Frank Wernex — April 2, 2010 @ 7:36 pm
It’s really well done! Respect to author.
Comment by AllettyCoonna — April 27, 2010 @ 2:57 pm
Just want to say what a great blog you got here!
I’ve been around for quite a lot of time, but finally decided to show my appreciation of your work!
Thumbs up, and keep it going!
Cheers
Christian, Satellite Direct Tv
Comment by elobinalgarie — May 18, 2010 @ 1:25 pm