Searching for multiple items from a list in a second list

Searching for multiple items from a list in a second list

I have the following code...
  1. if ($("#filter_chemistry").val() != "") {
  2. $("td.polymerTypel").not(":contains('" + $("#filter_chemistry").val().toLowerCase() + "')").parent().hide();
  3. }
Where #filter_chemistry is a form text field, and the td's with the polymerTypel class will contain a list of items similar to st,ac,bde,va for example.

If I enter "ac" into my text box, all table rows NOT containing ac in the list will be correctly hidden, all good so far.

What I want is to be able to enter ac,va into the text box and have both of these items required, but not in any specific order or location.

I assume some sort of $("#filter_chemistry").val().split(",") will be required to create an array but it is beyond me. Can anyone help please?

Thanks.