I want to build a userscript to change a style attribute within a <section> tag, along these lines:
<section class="adam" style="thing: annoying" >
where I want to switch it to something like
<section class="adam" style="anotherthing: ok" >
Any pointers appreciated
NickMNS
3:35 pm on Nov 29, 2019 (gmt 0)
This should do what you would like. Note that I used actual style values for the demo. The background of the "section" should appear as color "peachpuff". But the js removes that style and replaces it with color=red, which changes the font color to red and that is what is displayed. There is not event listener to trigger the code. This happens immediately at page load so the peachpuff background is never displayed.
HTML:
<section class="adam" style="background: peachpuff" >Section</section>