I'm trying to add a button in an HTML block in my blog post:
padding: 10px 20px;
<button class="button" onclick="window.parent.location.href = 'https://www.w3docs.com';">Go</button>
I get the following messages in the console:
Uncaught DOMException: Failed to set the 'href' property on 'Location': The current window does not have permission to navigate the target frame to 'https://www.w3docs.com'.
at HTMLButtonElement.onclick (https://static.parastorage.com/unpkg/@email@example.com/dist/statics/html-plugin-embed.html:1:1787)
onclick @ html-plugin-embed.html:1
If I use window.location.href = instead the window.parent.location.href = , the link opens but inside the same HTML frame.
What do I do wrong? Thank you.