How to add property to existing class

后端 未结 6 1555

I have got a CSS class like so:

.simpleClass {
    width: 25px;
}

And I have a matching element:

6条回答
  •  梦毁少年i
    2021-02-19 12:13

    The property will be added to div if it already not exist in css class. Hence, it's always better to switch css class with new properties. Eg.

    $( ".referenceClass" ).switchClass( "oldClass", "newClass");
    

提交回复
热议问题