css works in IE not FF

css works in IE not FF

Hello,
The following works in IE8 but not firefox. q is a variable that is an id:
an example of the selector is (.names #AAA)
$(
".names #" +q).css( "background-color" , "yellow" );
 
I get nothing in FF.
Thanks