Add to a css class using JQuery

后端 未结 6 2212
不知归路
不知归路 2020-12-11 03:14

Is it possible to add/update a css class using JQuery.

I know I can add css to a DOM element using this add css rule using jquery, but I would like to add/remove fro

6条回答
  •  臣服心动
    2020-12-11 04:06

    If you want to add new class or properties use add class

    http://api.jquery.com/addClass/

    which will add the properties to the DOM elements.

    If you want to overwrite the existing properties use jquery .css , in your case Update

    http://api.jquery.com/css/

    .css will add as an inline style , so all your class properties will be overwritten

提交回复
热议问题