I'm trying to get the class of the selected option and use that in a compare statement to find which class it is.
I get an undefined value. The option tag has a class set to it.
Why am I not getting a value back?
Html:
<select name="datagrid_filter" onchange="startFilter();">
<option>All</option>
<option disabled="true">Assignment:</option>
<option disabled="true">Client:</option>
<option disabled="true">Type:</option>
<option class="type" value="Activity">   Activity</option>
<option class="type" value="Alert">   Alert</option>
<option class="type" value="Lead">   Lead</option>
<option class="type" value="Notification">   Notification</option>
</select>
Javascript:
var cs1 = $("option:selected", this).attr("class");
if(cs1 == 'Type'){
//do something
}