I have a dropdownlist to which I bind data in c#. After binding, I assigned class to individual items based upon a condition.
foreach (ListItem li in ddlTrend.Items)
{
if (li.Value == "S")
{
li.Attributes["class"] = "optionGroup";
}
else
{
li.Attributes["class"] = "optionChild";
}
}
The code of CSS is
.optionGroup {
font-weight: bold !important;
}
.optionChild {
padding-left: 15px !important;
}
Now this works perfectly in IE (v 11)
and Firefox (v 30)
but does not works in Chrome (v 36)
Any help would be appreciated