Get Class Name Using jQuery
Here we consider how to get the class name using jQuery.
Lets start with one example here.
Suppose we have a div with class clsDiv as shown here.

The Div id is divID.
Now for getting the class name of this Div, we can use following code.
$(function () {
var ClassName = $('#divID').attr('class');
});
$(function () {
var ClassName = $('#divID').prop('class');
});
In jQuery, we first find the Div by using its ID.
And then retrieve its attribute named class using jQuery attr or prop.
That's all, by this way we can get the class name of form element using jQuery.