79385680

Date: 2025-01-24 21:36:27
Score: 2.5
Natty:
Report link

Try eval() (js) or <iframe> (html) with document.querySelector('iframe').contentDocument.scripts[0].innerHTML (js) and same with the css and html. If that doesn't work then I don't know.

document.querySelector('div.js-editor').addEventListener('blur',()=>{
try{
document.body.appendChild(document.createElement('div')).innerText=eval(document.querySelector('div.js-editor').innerText)
}
catch(e){
document.body.appendChild(document.createElement('div')).innerText=e
}
});
<!DOCTYPE html>
<html>
<body>
<div class="js-editor" contenteditable="true">
/*code here*/
</div>
</body>
</html>

Does that help?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Roen le Bennett