TAG
JavaScript
Result
Run
License
<iframe id="myiframe" src="about:blank"></iframe> <p><button type="button" id="btn-load">Load</button></>
window.addEventListener("load", () => { const $elIframe = document.getElementById("myiframe"); const $elBtnLoad = document.getElementById("btn-load"); $elBtnLoad.addEventListener("click", () => { $elIframe.srcdoc = "
Hello
"; }); });
Console
expand_less
License
License
by DevDic
Close