Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple browser console-like html setup
I use this setup primarely on jsfiddle where I do not want to open chrome console while testing js code.
<!-- a Mono-spaced font-->
<link href="" rel="stylesheet">
ul#console {
list-style-type: none;
font-family: 'Roboto Mono', monospace;
font-size: 14px;
line-height: 25px;
padding-left: 5px;
ul#console li {
border-bottom: solid 1px #80808038;
<ul id="console"><ul>
// adds entry to the html #console
function log(txt){
var newLine = document.createElement("li");
newLine.innerHTML = (typeof txt === 'string') ? txt : JSON.stringify(txt, null, 4);
Copy link

brainstormot commented Apr 16, 2018

Simple and Good code, thanks!

Copy link

jsa2 commented Sep 6, 2021


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment