if page has class jquery code example
Example 1: jquery check if a class exists
if ($(".mydivclass")[0]){
} else {
}
Example 2: if a class exists jquery
if ($(".mydivclass").length){
} else {
}
Example 3: how to find a name of class from page in jquery
if ($(".Mandatory").length > 0) {
$(".Mandatory").each(function() {
$(this).doSomejQueryWithElement();
});
}
Example 4: how to find a name of class from page in jquery
if ($('.Mandatory').length > 0) {
}
Example 5: how to find a name of class from page in jquery
$('.Mandatory').each(function(){
});