I’ve been looking through the questions, but i can’t find exactly what i’m looking for..
I want to know how to make a function that does the following:
- If you hover an element the element
changes to blue for example - If you unhover it changes back to
default - If you click it (focus), it keeps
the blue color from the hover effect
even if you unhover it - If you click away (blur), it goes
back to the default color and the
mouseover effect works again
How do I do so ;)?
Update : don’t use jQuery.
Plain CSS solution :
jsFiddle demo here : https://jsfiddle.net/ngkybcvz/
Using different CSS classes could be a solution.
jsFiddle demo here : http://jsfiddle.net/ZRADe/