I am using the TinyMCE to add content to CMS pages and static blocks. With TinyMCE editor disabled I add HTML and javascript code. For example
<h2>What Can JavaScript Do?</h2>
<p id="demo">JavaScript can change HTML content.</p>
<button type="button" onclick='document.getElementById("demo").innerHTML = "Hello JavaScript!"'>Click Me!</button>
Save the page and reopen it. The page opens with a TinyMCE editor showing the content. But when I switch to a simple editor to edit the content, the js code is stripped. This is what I see.
<h2>What Can JavaScript Do?</h2>
<p id="demo">JavaScript can change HTML content.</p>
<p><button type="button">Click Me!</button></p>
I have this problem with Magento 2.3 & 2.4 What am I doing wrong?
Thanks