diff --git a/src/components/CodePlayground.jsx b/src/components/CodePlayground.jsx index 8c2939788..fe528e8ec 100644 --- a/src/components/CodePlayground.jsx +++ b/src/components/CodePlayground.jsx @@ -106,12 +106,13 @@ export default function CodePlayground({ language = 'javascript', initialCode = const executeCSS = () => { try { if (iframeRef.current) { - const htmlContent = ` + const iframeDoc = iframeRef.current.contentDocument || iframeRef.current.contentWindow.document; + iframeDoc.open(); + iframeDoc.write(`
-