mistake:
jquery adds a class style to the dom element. Using addClass to add a style will not take effect. Only using css() to add a style will take effect.
$("#id").addClass("checkColor"); does not take effect
Modify to: $("#id").css("background","#0F8100") to take effect
reason:
The issue of style priority. The priority of the parent style is higher than the priority of the later set style, so the style with higher priority will be rendered.
Solution: The priority of the styles in the appended classes should be increased
!important, the function is to increase the application priority (priority) of the specified style rule
As shown below:
.checkColor{
color: white;
background: #0F8100!important;
}