我如何在 .gsp 文件 (Grails) 中 remove/add css 类 (以及一般样式)?

How do I remove/add css classes (and just general styling) in .gsp files (Grails)?

我想 add/remove class 和 DOM 元素的其他样式,基于 .gsp 文件是否到达代码的特定部分,或是否传递 if -健康)状况。这是怎么做到的?

这就是你如何做到的...

if(condition)
{
  $(selector).addClass("theclassname");
  $(selectorAnother).addClass("theclassnameAnother");

}