Input focus for firefox and safari doesn't seem to work

Input focus for firefox and safari doesn't seem to work

The following should refocus an input element with a name of 'test' if it contains an empty string. This works for IE (8.0.7600) but not in Firefox (3.6.15) or Safari (5.0.4)
  1. $('input[name=test]').blur(function() {
  2.   var $this = $(this);
  3.   if (!$this.val()) {
  4.     $this.focus();
  5.     return false;
  6.   }
  7.   return true;
  8. });