Problem finding previous class

Problem finding previous class

Hello,

I have a table that has headings that have classes to identify which group Im working in. Im trying to get the class of the group(a previous tr).

var $classes = $(this).prev(".itemno").prop("class");

But it's not returning the class. It's returning undefined. What shouldl I be using?

<table>
<tr class="itemno itemno1"><td></td> <td></td> <td></td></tr>
<tr ><td></td> <td></td> <td></td><td>button</td></tr>
<tr ><td></td> <td></td> <td></td><td>button</td></tr>
<tr class="itemno itemno2"><td></td> <td></td> <td></td></tr>
<tr ><td></td> <td></td> <td>button</td></tr>
<tr ><td></td> <td></td> <td>button</td></tr>
<tr class="itemno itemno3"><td></td> <td></td> <td></td></tr>
<tr ><td></td> <td></td> <td>button</td></tr>
<tr ><td></td> <td></td> <td>button</td></tr>
</table>

Thank You