<!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>
原文地址:https://www.cnblogs.com/xiaobaizitaibai/p/8626494.html
时间: 2024-10-10 10:14:31