I have some content that consists of an image with a hidden link. (It used to be a button, but I found that the button was being stripped out entirely. If there's a way to fix this, I will probably go back to the button.)
<div class="divbutton">
<p>
<img src="data:image/jpeg;base64,foo" alt="Xsctn_Strat-Struct.jpeg" title="Xsctn_Strat-Struct.jpeg" style="width: 100px" class="Figure-Preview" id="64319096-9a51-418d-a11b-e70d25d9cb0e" contenteditable="false" draggable="true">
<a contenteditable="false" onclick="parent.image_preview(document.getElementById('64319096-9a51-418d-a11b-e70d25d9cb0e').src)">EXPAND</a>
</p>
</div>
When I inspect the <a> element, it's missing its onclick (and contenteditable attribute, although that is not critical.)
If I manually recreate the onclick event in the DevTools, it works perfectly.
How can I stop it from being removed?