Here is a little snippet if you're trying to check wether element contains a class, without using jQuery.
From http://sonnyt.com/javascript-check-if-element-has-class/