CSS how to change color of a specific primary-panel in a if-block

Tags: css

Problem :

I have many panels and want to change the color of a primary-panel after the counter is 10;

this.dateUpdate = function (element) {
      if (hasfocus == element) {
         dateCounter += 1;
          if (dateCounter == 10) {
              dateCounter = 0;

This is not working:

.changecolor > .panel-primary {
   background-color: #e1e1e1 !important;

to remember, I just want to change the specific one, and not all.

Thx in advance.

Solution :

If the panel-primary div is inside changecolor div

.changecolor .panel-primary {
   background-color: #e1e1e1 !important;

If the panel-primary div is the same div in which changecolor class is getting applied

.changecolor.panel-primary {
   background-color: #e1e1e1 !important;

    CSS Howto..

    How to add color to text in my div with code

    How do I make the background transparent?

    How to add a gradient/filter in the image in CSS

    How to deploy just HTML, CSS webpage to jetty?

    How can i display images horizontally using PHP and mysql?

    How can I use CSS to show and hide multiple elements at once?

    CSS show horizontal scroll bars?

    How to set -fx-max-width to USE_PREF_SIZE in JavaFX css?

    How to do mutiple css class in one line javascript code

    HTML/CSS current active menu does not show active

    How to get the navigation bar to align to the center

    How to style CSS for input box's width as a percentage when it has border and padding?

    How to control the expandability of textarea from width perspective

    How to center list of links in a straight line. CSS

    How to change width of object in mobile version

    How to place an icon on the first line and text on the second line?

    CSS how to target background and make it transparent

    How can I add read more click event to only open one news article?

    div how to make its dimensions exactly as those of the contents

    How to style diff implementation for PHP with CSS

    CSS horizontal scroller, how to position “below” before “right”?

    How to make div layer unselectable in jquery and css

    How to rotate a div, while jQuery animates the same div

    How do I change the a border-color on rollover?

    How would I create global scripts within HTML Pages so I don't need to constantly change the location?

    How should I keep webpages consistent [closed]

    How to set height of vertical tab in css?

    How to position 3 images on top of one another and retain responsiveness using just CSS?

    how to center a webpage in CSS

    How to not display css padding when span element is empty