I just started using jquery

I just started using jquery

I have this code  which works for ver 1.4x but does not work for latest version is there any thing I am missing out or there is some problem in jquery....

  • there is no focus on tabindex 0
  • error message in class error does not shows up when the input text blurs out
  • only line working is $('.error').css('display','none');

$(document).ready(function(){
$('.error').css('display','none');
$('input:[tabindex="0"]').focus();
$('.req').each(function(){
$(this).blur(function(){
var da=$(this).val();
var len=da.length;
if(len<1)
{
$(this).next('.error').show();
$(this).focus();
}
else
{
$(this).next('.error').hide();
}
});
});
});