There are tools available for demoing code in the browser such as Stackblitz or codepen that could serve this purpose. You can create basic websites and preview them, there is also the option of opening the console. I personally prefer codepen as it does not require someone to register and you can access the console (bottom left button) and see it's contents. To open codepen without registering go to the link
codepen.io/pen
This suggestion was done in the comments by @Bergi so credits to him.