Checking of CSS classes in JavaScript

Given an element:

<p id="elem" class="www ggg zzz"></p>

Check if it has the class ggg.

enru