Can I use non existing CSS classes?

后端 未结 13 1854
北荒
北荒 2020-11-27 12:54

I have a table where I show/hide a full column by jQuery via a CSS class that doesn\'t exist:

相关标签:
13条回答
  • 2020-11-27 13:57

    It will have no effect if you apply a class on a HTML element, and that class is not defined in CSS. It is a common practice and like Aamir afridi said if you are using classes for js only purpose, it is a good practice to prefix them with js- .

    It is not only valid for calsses, but also for id attribute of html elements.

    0 讨论(0)
提交回复
热议问题