remove / reset inherited css from an element

前端 未结 9 1325
攒了一身酷
攒了一身酷 2020-12-06 04:00

I know this question was asked before, but before marking it as a duplicate, I want to tell you that my situation is a little different from what I found on the internet.

9条回答
  •  甜味超标
    2020-12-06 04:49

    As long as they are attributes like classes and ids you can remove them by javascript/jQuery class modifiers.

    document.getElementById("MyElement").className = "";
    

    There is no way to remove specific tag CSS other than overriding them (or using another element).

提交回复
热议问题