Suppose to have a code like this:
<div class="notSelected">
<label>Name
<input type="text" name="name" id="name" />
</label>
<div class="description">
Tell us what's your name to make us able to fake to be your friend
when sending you an email.
</div>
</div>
Now suppose I've something like this (it's just an example) for each element of a form. I'd like to change the style from notSelected to Selected when:
- User focus on the input element
- User move the mouse over a notSelected div
When he change focus the Selected div should became notSelected again.
I'd like to do something like this to increment the size of the text of the selected div. Anyway it could be cool make other changes too so I'd prefer to change the class attribute.
What is the best way to do something like this in JavaScript? Is there any JavaScript framework that can boost me doing this thing? So it will be easy to add effects like fading etc...
I downloaded MooTools but with a fast read of the docs I did not see how to do this without having a specific ID for any of the forms div, but is the first time I use it. I've no problem using any other framework, but if you suggest one, please write also what should I look for specifically, thank you.