I have a static html file containing mostly text. Lots of text snippets are highlighted using the <mark>
tag. I would like to add a button that toggles the text weight of the marked text snippets between bold and normal. The intended effect is to switch on / off the highlighting.
Is there any magic way to do it by directly changing the style of the mark
css class?
Example:
- HTML:
... This is an <mark>important text snippet</mark> ...
- CSS class BEFORE I hit the button:
mark { text-weight: bold; }
- CSS class AFTER I hit the button:
mark { text-weight: normal; }
The reason why I want to do this is to allow the user to decide, if he wants to see highlighted text or not. I know I can change the style of each marked text snippet, but I am wondering, if there is a more direct way.