Looking at the page source, this is the code that’s appearing…
<button id="demo">Click me</button>
As you can see, some of it it missing. I suspect this is WordPress stripping it down, as I believe you’re adding it in a block.
An alternative suggestion may be to add this as a Code Embed as well. So, as well as CODE3, you might also add a new one, say, called CODE4, with this…
<button id="demo" onclick="myFunction()">Click me</button>
Then, in your post, keep wherever you’ve added {{CODE3}} but also add {{CODE4}} somewhere below it, where you want the button to appear. Because none of your code is being added into the editor, it prevents WordPress from modifying it.
Unfortunately it’s still happening
I have to put everything back to normal now (without the test button). I will try again tomorrow. Thank you very much for your help