Clickable pushed button

Al_sarvi used Ask the Experts™
Is there any way that I can careat a button that when somebody clicks on it, it looks like it is pushed..
I am lookig for a good flexible code that let me write my own text on the button or change its color and so on.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I believe you can create it as a rollover state but use "on click" rather than "on mouseover".


<INPUT type="button" value="Change to Yellow!" name="button3" onClick="document.bgColor='yellow'"> <br>

i include some code.

hope it help!



I know HTML and thanks for the code. I was just wondering if I can change color of the button or format of its text. There might be some flexible code generator somewhere that gets color, size and text and is able to create more beautiful 3-d button that when you click on it, it seems button is going inside and is being pushed. I think some Javascipt code is needed to change the origal image of button to the pushed image when it is clicked.


Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

You can use an image on a button, see the wonderful tutorials at

Hope this helps

Found this code from

Script:  Active Tri-State Roll-Over Images on Form Submit and Reset
         Script Boilerplate and Quick-Take Tutorial
Source:  (C) 2001 by at

Author:  etLux

Desc.:   This script shows how to use tri-state rollover images with
         forms, instead of the usual rather unattractive 'gray
         buttons' for Submit and Reset.

Follow the link to the code:

Looks cool. Think I'll find a use for it myself!
Good luck-

Style sheets are the way to go for this.  Have a look at  I did not change the style while active, at that site, but could have.

My experience is that a java script will give the false impression of a "sunken" effect, and for some applications that might be the way to go.

The thing is that the Java script won't change the style of the font, nor will it fill in small details of a 3D button.

My advise would be to create two graphics, which Photoshop will easily do --- one button that is up, and one button that is down.  Then use the HTML code to change between the two.

It also happens to be the lightest code size.  For Java to simulate it takes that much more code in your page.

looks to me like there were some answers here and that it is just that the questioner did not award points.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial