<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>txt</title> <style> p.i{ letter-spacing: 2px; } </style> </head> <body> <p></p> <script> function debug(msg){ var log = document.getElementById("debuglog"); if(!log){ log = document.createElement("div"); log.id = "debuglog"; log.innerHTML = "<h1>Debug Log"; document.body.appendChild(log); } var pre = document.createElement("pre"); var text = document.createTextNode(msg); pre.appendChild(text); log.appendChild(pre); } debug(‘s‘); </script> </body> </html>