jquery remove class

前端 未结 4 2072
礼貌的吻别
礼貌的吻别 2021-01-21 00:12

i got a class,

div.domtab div{
        clear:both;
        width:auto;
        background:#eee;
        color:#000;
        padding:1em 1.5em;
    }
         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-21 00:39

    The reason the above answers are correct, is because this method specifies "Class" in it's name, implying that it is ASSUMED you are giving it a valid class name. Being as "." implies a class, this becomes a redundancy.

    Thus, when using "removeClass" a "." should not be used.

提交回复
热议问题