Skip to content

Instantly share code, notes, and snippets.

Created December 11, 2017 19:34
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ahmed-musallam/d0378d3494744d412cb7b69a3313e2da to your computer and use it in GitHub Desktop.
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

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