JSFiddle - React, Tailwind, and code Playground

by Arnold Daniels

HTML

<iframe id="ownable" allow="midi; geolocation; microphone; camera; display-capture; encrypted-media; clipboard-read; clipboard-write; notifications; payment-handler; persistent-storage; background-sync; ambient-light-sensor; accessibility-events;" sandbox="allow-modals allow-forms allow-scripts allow-same-origin allow-popups allow-top-navigation-by-user-activation allow-downloads" allowfullscreen="" allowpaymentrequest="" frameborder="0" src=""></iframe>

JavaScript

localStorage.setItem('msg', 'foo');
console.log(localStorage.getItem('JSFIDDLE_editor_options'));

const frameDocument = document.getElementById('ownable').contentDocument;
const script = frameDocument.createElement('script');
script.textContent = 'console.log(localStorage.getItem("msg"))';
frameDocument.body.appendChild(script);