Answers for "body check if class exist in css"

CSS
1

apply css if class not present

.container:not(.container2) > .myDiv {
  color: red;
}
Posted by: Guest on August-31-2021
5

check if a class exists javascript

const element = document.querySelector("#box");

element.classList.contains("active");
Posted by: Guest on August-08-2020

Code answers related to "body check if class exist in css"

Browse Popular Code Answers by Language