what is your suggestion? somewhere you need "if (foo) cssClass1 else cssClass2" so you either need cssClass1/2 in the JS, or the if/then JS in the html.