hubrid hubrid - 1 year ago 198
jQuery Question

jQuery toggle focus

How can I toggle an element's CSS on focus/blur with jQuery?

$('.answerSpace').bind('blur', function(){

$('.answerSpace').bind('focus', function(){

So now I have this. But it doesn't quite work...

Answer Source


$('.answerSpace').bind('blur', function(){ $('.normProf').removeClass("normProf").addClass('opacProf'); });
$('.answerSpace').bind('focus', function(){ $('.opacProf').removeClass("opacProf").addClass('normProf'); });
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download