:contains variable

:contains variable

Hey guys, i'm having a problem with this:


  1. for(y=0; y<numbers_sold.length; y++){
          $("#stickers a:contains('" + numbers_sold[y] + "')").addClass('sold');
    }


If I substitute the variable "numbers_sold" for a number, it works. But it seems that this way it doesn't recognize the variable.

Hope you can help.
Thanks.