The default buttons produced by the tag <input type="button" value="Function-Mane"> or <button type="button">Function-Name</Button> are gray in color. The gray button color suits many backgrounds, just as the white shirt suits many colors of trousers. There are times when you need a different color shirt for a particular color of trousers. In a similar way there are times when you would need a button of a different color for your particular web page background.
Custom Buttons in HTML - Colored Button continued (Page 3 of 4 )
You would normally have more than one button where you want these same effects. The following code shows the complete code for two buttons, having the above effects:
When an event is triggered, a function is called with the ID of the button, passed as an argument. The JavaScript functions take the ID as an argument.