Skip to content
Advertisement

Modifying attributes and texts that follow simple patterns

Here is my initial unuseful code.

JavaScript

I would like that the browser works with the following code for the body where [[ ... ]] has been cut, and {{ SOMETHING }} is become <span style = "color: red;; font-weight: bold;">SOMETHING</span>.

JavaScript

I have no control on the DOM structure, and the places where [[ ... ]] and {{ ... }} are used.

Advertisement

Answer

You can also do it by modifying document.body.outerHTML directly:

JavaScript
JavaScript
Advertisement