Highlighting Forms
This is quite a well known but under used technique for highlighting your form elements without any JavaScript. By using the CSS property focus you can apply style to a form element when it is clicked, also know as focus.
Example:
The HTML
The HTML is really simple all you need is a input box:
<input type="text" />
The CSS
The css can be approached by one of two ways you could either apply a class name to any form element which is applicable.
input:focus.yourclassname { background-color: red; }
or you can use the CSS selectors to highlight every form like this.
input[type="text"]:focus { background-color: red; }
The focus selector only works in the modern browsers, and not ie7 and below. if you want this to be compatible with ie6 use this javascript, along with prototype.
$$('input[type="text"]').each(function(element)) { event.observe(element, 'click', function() { element.toggleclassname('yourclassname'); }); });