Is this a jQuery bug, or is it my code?

Is this a jQuery bug, or is it my code?

Hi, I'm a relative newbie, so I'd thought I'd check here before raising a ticket in case I've screwed up.

I have the following code:

$(document).ready(function() { 
       $('.req').addClass("emptyField"); 
       $('.req').focus(function() { 
              $(this).removeClass("emptyField")
              this.select(); 
       }); 
       $('.req').blur(function() { 
              if ($.trim(this.value == '')){ 
                     this.addClass("emptyField");  
              }
       }); 
});

The class '.req' is applied to some <input type=text...> fields. When I tab out of a field leaving it empty, I get the following javascript error:

(a || "").replace is not a function
d)===false)break}else for(;e<j;){if(b....var d=0,f=b.length;d<f;d++)if(b[d]===      jquery-1.4.2.min.js line 30

Is it my code that is wrong, or is there a bug? Thanks for any help.