New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact
Categories
Other Sections
Sweet Ads
Compatibility
Bookmark online:

FF1+ IE5+ Opr7+

Rollover background-color button

Author: Dynamic Drive

Note: Updated Jan 22nd, 04' for link target ability.

Description: A script that makes any form button change background color as the mouse moves over it.

Demo:


Directions: Developer's View

Step 1: Insert the below into the <head> section of your page. Change the color name at ".initial2" to the color you want applied initially to the button:

Select All

Step 2: Insert the below anywhere into the <body> section of your page Change the two color names in function "change()" to reflect the ones applied while the mouse is over the button, and off, respectively. Change the target URLs in function "jumpto2()" to your own (ie:http://www.yahoo.com):

Select All

To add more form buttons, simply add more of the following inside the <form> tag:

<input type="button" value="Yahoo" 
class="initial2" onClick="jumpto2('http://yahoo.com')">

With the parts in red representing the parts you should change to your own.