1 and 2: use CSS.
like:
In CSS (blur is a base class):
.blurry{background:red;}
.blurry:hover{background:blue;}
.focused{background:blue;}
IN js:
$(document).ready(function() {
$('#elementID').focus($(this).addClass('focused').removeClass('blurry');)
});)
$('#elementID').blur($(this).addClass('blurry').removeClass('focused');)
});
CSS will track mouseover / mouseout events without having to interact with the DOM. And js does the rest :)
source
share