JS Ground

JS Ground

JS Ground is a small JavaScript snippet that allows embedding a small JavaScript playground to any html page just by adding:
  • a <div> with a class "jsground"
  • a script link go jsground (which you should host yourself for obvious security reasons)

The playground is simplistic, it is an html textarea with no editor function, no code completion, and it is not capturing the console output (you need to open your browser console). However the code is run in a new scope each time, meaning you can use const, let etc... (unlike in the browser dev console).

Text in the div will be added to the playground automatically when the page loads, and when reset is clicked.

Without pre-loaded code (empty initial value):
<div class="jsground"><div>
<script src="https://yves.zioup.com/jsground/jsground.js"></script>
With pre-loaded code:
<div class="jsground">
  alert("does this work?");
<div>
<script src="https://yves.zioup.com/jsground/jsground.js"></script>

Source and example: https://github.com/dorfsmay/jsground

Ground