jquery if html has class code example
Example 1: jquery hasclass
if ($( "#foo" ).hasClass('className')) {
$( "#foo" ).removeClass( 'className');
} else {
$( "#foo" ).addClass( 'className');
}
Example 2: jquery hasclass
$( "#mydiv" ).hasClass( "foo" )
Example 3: button has class or not c#
if(el.getAttribute("class").split(" ").contains("disabled"))
{
}
or
#region HTML Method
public static bool hasClass(WebControl element, string strClass)
{
return Convert.ToString(element.Attributes["class"]).Split(' ').Contains(strClass);
}
#endregion