htmldiv class=tc-tiddler-body tc-revealh2 class=Read Meh2pUsage Click the svg width=22pt height=22pt class=tc-image-ri-screenshot-2-line tc-image-button viewBox=0 0 24 24gpath fill=none d=M0 0h24v24H0
这是一个包含 HTML 标记的字符串。要在控制台输出这种数据结构,可以使用 console.log() 函数将该字符串作为参数传递给它。例如:
console.log('<div class="tc-tiddler-body tc-reveal"><h2 class="">Read Me</h2><p>Usage: Click the <svg width="22pt" height="22pt" class="tc-image-ri-screenshot-2-line tc-image-button" viewBox="0 0 24 24"><g><path fill="none" d="M0 0h24v24H0z"></path><path d="M3 3h2v2H3V3zm4 0h2v2H7V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm4 0h2v2h-2V3zm0 4h2v2h-2V7zM3 19h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3V7zm7.667 4l1.036-1.555A1 1 0 0 1 12.535 9h2.93a1 1 0 0 1 .832.445L17.333 11H20a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h2.667zM9 19h10v-6h-2.737l-1.333-2h-1.86l-1.333 2H9v6zm5-1a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"></path></g></svg> icon on the Tiddler toolbar to export the current Tiddler as a PNG image.</p><h2 class="">Credits</h2><ul><li><a class="tc-tiddlylink-external" href="https://github.com/tiddly-gittly/Modern.TiddlyDev" rel="noopener noreferrer" target="_blank">tiddly-gittly/Modern.TiddlyDev</a></li><li><a class="tc-tiddlylink-external" href="https://github.com/niklasvh/html2canvas" rel="noopener noreferrer" target="_blank">niklasvh/html2canvas</a></li></ul></div>');
这将在控制台中打印出该字符串
原文地址: http://www.cveoy.top/t/topic/iTae 著作权归作者所有。请勿转载和采集!