Skip to main content

JavaScript Playground

The JS tab is where action happens here. The HTML tab has a minimal structure with some elements to target via DOM APIs. console.log() output appears in a panel below the preview.

JS focused
Ctrl+Enter
HTML
CSS
JS
Preview

What to Notice

  • Every button click calls console.log — watch the panel below the preview update.
  • The JS accesses DOM elements by id — the HTML tab defines those elements.
  • The CSS tab styles the buttons — try switching to it and removing the border.

JS Experiments

  • Add a max so the counter can't go above 10.
  • Change the + button to increment by 5 instead of 1.
  • Try console.log(typeof count) — what does it log?
  • Add a <p> in the HTML tab and update its text from JavaScript.

Limitations

Since this runs in a browser sandbox (not Node.js):

  • No require() / import — no modules
  • No file system, no network requests
  • No Node.js built-ins (fs, path, process)

For DOM, math, strings, arrays, closures, and async — it works perfectly.