       }
                        <\/script>
                    </body>
                    </html>
                `;

        iframeDoc.open();
        iframeDoc.write(html);
        iframeDoc.close();

      } catch (error) {
        console.error('Error running code:', error);
        const iframe = document.getElementById('previewFrame');
        const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
        iframeDoc.open();
        iframeDoc.write(`
                    <div style=