Skip to content

Instantly share code, notes, and snippets.

@marvinhagemeister
Created May 23, 2024 22:53
Show Gist options
  • Select an option

  • Save marvinhagemeister/cd53192855c7de649a2b62d0e87a8c0e to your computer and use it in GitHub Desktop.

Select an option

Save marvinhagemeister/cd53192855c7de649a2b62d0e87a8c0e to your computer and use it in GitHub Desktop.

Revisions

  1. marvinhagemeister created this gist May 23, 2024.
    22 changes: 22 additions & 0 deletions noscript.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    </head>
    <body>
    <h1>hello</h1>

    <div id="target"></div>
    <script>
    const el = document.getElementById("target");
    const noscript = document.createElement("noscript");
    const style = document.createElement("style");
    style.textContent = "*{outline: 1px dotted orange;}";

    noscript.appendChild(style);
    el.appendChild(noscript);
    </script>
    </body>
    </html>