JSFiddle - React, Tailwind, and code Playground
by dmethvin
HTML
<div contenteditable="true">
<p>Some text</p>
<img id="myImg" src="http://contenteditable.com/lib/imgs/house.jpg"/>
</div>
<button id="myBtn">Get Result</button>
Result: <span id="res"></span>
JavaScript
document.getElementById("myImg").aprop = 10;
document.getElementById("myBtn").onclick = function(){
document.getElementById("res").innerHTML =
String(document.getElementById("myImg").aprop);
};