[jQuery] focusin / focusout - Mouse Events

$('#box0').focusin(function(){ $(this).css("background-color", "#aaffff"); });
$('#box0').focusout(function(){ $(this).css("background-color", "transparent"); });

focus/blurで同じコードを記述すると、正しく動作しない。
focusin/focusoutは、バブリングしたイベントも捕捉することができるためイベントの取得が可能となる。

$('#box1').focus(function(){ $(this).css("background-color", "#eeeeee"); });
$('#box1').blur(function(){ $(this).css("background-color", "transparent"); });