Using CSS !important with JavaScript

前端 未结 3 702
不知归路
不知归路 2021-02-20 01:35



        
3条回答
  •  执念已碎
    2021-02-20 01:54

    Here is 2 different script, one target an element's CSS property and the other its style.

    A heading with class="example"

    A paragraph with class="example".

    Click the button to add a background color to the first element in the document with class="example" (index 0).

    Note: The querySelectorAll() method is not supported in Internet Explorer 8 and earlier versions.

提交回复
热议问题