I have a list of things, lets say it's movies to make it easy. All of these movies have genres, some have one, some have more then one, What I am trying to do is make a javascript filter that remove the unwanted movies (movies that does not fit the genres selected in the filter form) from the list.

It can be done by loading the whole list into a two dimensional array, and then regenerate the list every time the filter is changed using javascript. But that sounds very crude and resource demanding, I want it to happen instantly, and with this method it might be very slow on computers with limited resources.

I thought about giving each item in the list an id and hide them those that does not fit the filter, but I couldn't figure out how to do the actual filtering this way.

Any other ideas on how to do this more effectively?