Working with the CSSstyleSheet API
- Changing the selectorText -

Test 5 - adapting the script for IE-11

Instead of using the Developer Tool in order to change the selectorText's (impossible in IE-11), now we'll change them by javascript only.
As said, the cssRule.selectorText is readonly in IE-11, and can not be used. But IE-11 can delete a whole style rule, and also insert a new style rule, like the other browsers. This is used as a workaround:

See what happens!

Testing a style update

This is ".testbox1"This is ".testbox2"

The initial selectorText for each style rule of the 2nd style block is:

*
main code
.testbox1
.testbox2

The updated selectorText for each style rule of the 2nd style block is:

*
code
.otherClass
 

Results

Conclusions

Francky Kleyneman, 5 jan. 2019