What do square brackets in class names mean?

前端 未结 6 818
清酒与你
清酒与你 2020-12-02 06:41

I saw here square brackets that are used in class names:



        
6条回答
  •  独厮守ぢ
    2020-12-02 06:57

    There is no particular rule within a class name. In your example they are almost certainly being used by a JavaScript validation framework. This is because in HTML you can't simply add your own attributes to tags, therefore the validation framework is exploiting the fact that CSS class names can contain such characters in order to 'store' the validation rules within the class name. There won't actually be any corresponding class in the style-sheet - this is just a trick to work around the limitations of HTML.

提交回复
热议问题