If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Form background-color change on focus

I'm trying to achieve this effect (http://secondandpark.com/ - contact form, bottom of page) that when the user focuses on an input field the background of the input changes colors. Is there a pure CSS way of doing it? If not, what are my options? Here is my code:

You need a way to target the <li> but when you click on either an input or textarea. You wouldn't set the :focus psuedo on the <li> but rather on the inputs and textarea. There's only one way I would know how to achieve this.

You need a way to target the <li> but when you click on either an input or textarea. You wouldn't set the :focus psuedo on the <li> but rather on the inputs and textarea. There's only one way I would know how to achieve this.

Almost all JavaScript works best when attached just before the </body> tag as then the page appears to load a lot faster.

Suck a trivial task as this is best done directly with JavaScript rather than dragging in the entire JQuery library. It does require perhaps three times the amount of code to be written that calling JQuery would but you get rid of the thousands of lines of unneeded code from JQuery that you are not even using.

Possibly the following (untested) code will do it without the need for JQuery at all: