Skip to the main content

The Playground: what it does

This page describes the Playground at /editor/: its three code panes and live preview, the keys, what is stored, what a preview can and cannot do, and how it makes a movie. It is written from the same file the Playground's Help dialog reads, so the two cannot disagree.

The three panes

Write HTML, CSS and JavaScript in three panes. The preview shows the result and runs after a short pause when you stop typing. The Run button runs it at once.

Tab inserts two spaces. Autocomplete (Ctrl+Space, or Complete on a touch device) suggests HTML, CSS and JavaScript words. Format code tidies one pane or all three, and one undo puts the old text back. Clear all empties the panes and offers Undo for ten seconds.

Leaving a code field with the keyboard

Press Esc, then Tab (or Shift+Tab) to move focus out of the code field. Tab on its own indents. On a touch device the Done button in the symbol row moves focus out.

Keyboard shortcuts

These keys work while focus is inside the Playground. Every one also has an entry in the menu. They need a keyboard.

Keys in the Playground
ActionKeys
RunCtrl/Cmd+Enter
SaveCtrl/Cmd+S
FormatShift+Alt+F
Find, replaceCtrl/Cmd+F
Toggle commentCtrl/Cmd+/
HTML, CSS, JS paneCtrl+Shift+1, 2, 3
AutocompleteCtrl+Space
Leave the code fieldEsc, then Tab
Toggle consoleCtrl+Shift+Y
HelpF1, or the Help button
Leave fullscreen, close menu or dialogEsc
Stop a recordingThe Stop button, or Ctrl+Shift+E

Running and auto-run

The status line says Live while auto-run is on, Paused when it is off, Running while a preview starts, a count such as "2 errors" after code that reported errors, Not run for code that came from a link or a file before you press Run, and Stopped after a preview was stopped. The word comes from the Playground; the error count is whatever the preview reported.

A preview that does not answer within 3 seconds is removed and auto-run is paused. Settings has "Give slow code more time (10 seconds)". Press Run to start again.

If the last session ended while a preview was running, the Playground opens with auto-run paused. Opening /editor/?norun=1 always starts that way.

What a preview can and cannot do

A preview runs in a sandbox. In Chrome 143 on 3 December 2026 code in a preview could not read this site's storage or cookies, open windows, start downloads, use eval, or load or send anything to another site with fetch, XMLHttpRequest, WebSocket, forms, images, scripts, styles or fonts. Browsers have no switch for one feature, WebRTC; the Playground removes it from previews as a precaution. Previews cannot contain frames or declarative shadow roots, and cannot leave their page.

Console lines, the error count and the status word are whatever the previewed code chooses to send. They show what the code reported, not a check of the page.

Not supported in a preview: document.open() after the page has loaded, alert, confirm and prompt as browser dialogs (they appear as console lines), and a console input line, because previews cannot run eval.

Files from other sites

Previews cannot load files from other sites. Use the libraries listed under Libraries, or the sample files this site hosts.

Storing data

Previews cannot store data: localStorage, sessionStorage, indexedDB and cookies are blocked. Keep values in variables while the preview runs.

eval and new Function

Previews cannot run eval or new Function. Write the code out instead of building it from a string.

Web workers

Previews cannot start web workers.

Frames and embedded objects

Previews cannot contain frames, embedded objects or declarative shadow roots. They are removed when they are added.

Sending forms

Previews cannot send forms. Cancel the submit event in your script and show the result on the page instead.

Opening windows

Previews cannot open windows.

alert, confirm and prompt

alert, confirm and prompt do not open browser dialogs. They write a console line and return nothing, false or null.

Links do not leave the preview. Only links that point inside the page, such as #section, work.

Libraries and sample files

The only library on the list is XON 2.1.2. It is written into the preview by this page, so it is downloaded once. The same dialog lists the sample files this site hosts. There is no box for a web address: previews cannot load files from other sites.

Where your work is kept

Projects are stored in this browser on this device. They are not uploaded. They are removed when you clear site data, and your browser may remove them on its own, for example when the device is short of space or when a private window closes. Download a ZIP of anything you want to keep.

Each browser tab keeps its own draft. Before anything replaces what is in the panes (a link, a snippet, a template, an import, New), your work is kept under Recent drafts, the last 10 of them. A project may hold 1 MB of code, and the browser holds 200 projects.

Share links

Share puts the code into the address after the # sign, compressed. Nothing is sent to this site for that part of an address. Anyone with the link can read the code and the project's name. A link opens with the code NOT run, under a banner, until you press Run. Links over 2,000 characters may be cut by some programs, so test them after pasting. The Playground refuses to make a link longer than 60,000 characters in its token and offers a ZIP instead.

Export and import

Export makes a ZIP (index.html, style.css, script.js, playground.json and README.txt, plus the XON files when XON is ticked), one HTML file for quick viewing, or a JSON file. Import accepts a Playground ZIP, a JSON file or one HTML file as a new project that has not been run. A ZIP is refused whole if it is over 5 MB, holds more than 50 files, uses ZIP64, is encrypted, has two files with one name, or holds a file that unpacks to more than 1 MB.

Make a movie

Make a movie records the Playground while the finished code is typed back, with the live preview. The film has no sound. Your browser asks for permission each time, and everything visible in the Playground is recorded. The film is made in your browser and stays in this tab until you download it. Nothing is uploaded.

The format is MP4 (H.264), made by your browser, where the browser can record it, and WebM otherwise. Tested in Chrome 143 on 3 December 2026. Recording this tab needs a desktop Chromium browser; elsewhere only Replay is offered. Films are at most 3 minutes long and 150 MB, and end with a 2 second hold.

The film is at most the size of the Playground on screen; the dialog says "up to" and the finished film shows the real size. If the window is shorter than the Playground, the Playground is made shorter while it is filmed and is back to its size afterwards.

When the film is finished, a window shows it with a Download button. Download saves a file named htmlcssjs-playground, then the date and time, ending in .mp4 or .webm, through your browser's own download, into the place your browser keeps downloads. Until you press Download nothing is saved, and closing the window removes the film from the tab. The film never leaves your device.

Accessibility

The Playground was checked with automated tools (axe) and by keyboard. Nobody has used the highlighted code fields with a screen reader. Settings has "Use a plain text box", a native text box for each pane, which is the sturdier choice for screen readers.

Phones and tablets

On a touch device the panes are stacked, a switch chooses Code, Preview or Both, and a row of symbols sits above the keyboard. This was run in Chrome's phone emulation only; no real phone has been used.

Limits at a glance

The same limits as in the sections above, in one place.

Limits
WhatLimit
A preview that does not answeris removed after 3 seconds
A projectmay hold 1 MB of code
Projects kept in the browserup to 200
Recent draftsthe last 10
A share linkrefused above 60,000 characters in its token; links over 2,000 characters may be cut by some programs
An imported ZIPrefused whole if over 5 MB or with more than 50 files
A filmat most 3 minutes and 150 MB, no sound, ends with a 2 second hold

What the Playground has

Each line below has an automated test in the Playground's own test suite. Features that are planned but not built are not listed.

  • Three editors with tabs (tab list, arrow keys, one CodeMirror at start)
  • Editing aids: auto-close, 2-space Tab, line numbers; touch: exact committed text, 16 px
  • Leaving the editor: Esc then Tab, Done on touch
  • Autocomplete (HTML, CSS, JS; XON attributes only when XON is ticked)
  • Format code (js-beautify 1.14.9, lazy, one undo)
  • Clear all with Undo, no browser dialog
  • Live preview, Run, Stop, auto-run; new iframe per run; hot CSS; no idle rebuild
  • Preview sandbox, guard, pre-flight, ping, version
  • Console: every method, safe printing, line numbers, filter, clear, plain words for blocks
  • Layouts and Back to code
  • Window dots: 24 px, named, tooltip, icon at rest, middle toggles every time
  • Fullscreen (whole and preview only), Esc leaves, focus returns
  • Divider: mouse, touch, keyboard
  • Preview widths (phone 360, tablet 768, full)
  • Templates and examples; ?snippet=, ?example=; bad values not echoed
  • Local projects, autosave, one draft per tab, quota and limits, damaged records
  • Share link in the fragment, short address for a snippet, limits, never auto-runs
  • Export ZIP, single HTML, JSON; import by picker and drop; hostile files refused
  • Settings saved and applied again
  • Accessible themes (Playground Dark, Light, High contrast); contrast measured on the rendered editor
  • Libraries: XON 2.1.2 written into the preview once; sample files listed
  • Menu (menu-button pattern)
  • Keyboard shortcuts and Help (list equals help.json)
  • Replay: typing the finished code back, scrub, pause, no unfinished script run
  • Make a movie: record this tab, MP4 (H.264) or WebM, limits, refusals, result screen
  • Phone layout (360 px)
  • No third parties, no inline code
  • Honest interface: no AI entry, no counters, every button does something
  • Accessibility baseline: axe in every theme at 1440 and 360 px, tree, focus rings
  • Component mode: edit in place, Reset, Save to my projects
  • Viewer mode: readable without JS, no CodeMirror, tap on cards, at most 3 frames
  • Copy code ("Copied" only after the clipboard accepted)
  • Status line: Live, Paused, Running, "n errors", Not run, Stopped
  • Find and replace
  • Toggle comment (per line, by the language at that spot)
  • Plain text box
  • Recent drafts
  • Trust mark and banner; outside code runs nothing before Run
  • Symbol row on touch
  • Safe start after a session that ended while a preview ran; ?norun=1

Tested in

Chrome 143.0.7499.169, on 3 December 2026. Desktop Chrome headless on Linux, and Chrome phone emulation; no real phone, no other browser.

No other browser and no real phone was used, so this page makes no statement about any other browser or device.