If you're checking to see if a HTML element has a class, you can use .hasClass('classname') which would return true or false.
Otherwise, if you're trying to see a list, I think you'll have split the string into an array. The other two answers that were just posted will show you how. :)