JSFiddle - React, Tailwind, and code Playground

!important beats jquery beats regular stylesheet css

by jonchius

HTML

<div class="box1">
</div>

<div class="box2">
</div>

CSS

.box1, .box2 {
    height: 100px; width: 100%;
}

.box1 {
    background: black !important;
}

.box2 { 
    background: blue;
}

JavaScript

// stylesheet !important rules over jquery 
$(".box1").css("background", "green");

// jquery rules over stylesheet
$(".box2").css("background", "red");