Why is jquery attr is not working for with error

Why is jquery attr is not working for with error

This is part of the code that I am using and I get an error on the line "var gar = $(this).attr("liRegDet") method.  Can someone tell me why?  I am using IE7 with no options to move higher at the present time.  The error is:SCRIPT450: Wrong number of arguments or invalid property assignment . which is being return from jquery.1.9.0.mni.js.Thanks.

  1.       $(xmlDoc).find("RegistrationDetails").each(function()
  2.             {
  3.  var gar = $(this).attr("liRegDet");   if (gar == rid){
  4.                     currentDMVExpired = $(this).find("RegistrationExpired").text()

  5.                     if(currentDMVExpired == "true")
  6.                     {  $("#DMVRegTable").css("border","2px solid #FF7171")}
  7.                     else  {  $("#DMVRegTable").css("border","2px solid #4297d7")    }