0

I am using this method to change CSS

$("#AllProducts li:contains('" + Product + "')").css("background", "white");

This works fine, but now I need to check two parameters when I change CSS like below

$("#AllProducts li:contains('" + Product + "')&&('" + iCategory + "') ").css("background", "white");

However, this doesn't work. I can't check if contains product and then if iCategory, I need them to be in the same object.

4

2 回答 2

2

我想你正在寻找这样的东西。简短的回答,试试这个:

$("#AllProducts li:contains('" + Product + "'):contains('" + iCategory + "') ")
于 2013-07-01T11:05:43.030 回答
0

关于什么:

$("#AllProducts li:contains('" + Product + "'):contains('" + iCategory + "')").css("background", "white");
于 2013-07-01T11:06:21.190 回答