កម្មវិធីនិពន្ធ HTML

How it works

Frequently asked questions

Embed this tool · 嵌入这个工具
Add this tool to your own website — it links back to Free Tool Directory. / 把这个工具放到你自己的网站上。
WordPress 用户:官方插件正在审核中,通过后一键安装;现在先用下面的代码。WordPress plugin under review — use the code below for now.
iframe
JavaScript widget · JS 小部件 (auto height · 自动适应高度)
\n'; } /*PURE-END*/ function heRender(){ var box=document.getElementById('result'); var code=document.getElementById('heCode').value; var frame=document.getElementById('hePreview'); if(!code.trim()){box.innerHTML='

'+citT('res_empty')+'

';box.classList.add('show');frame.removeAttribute('srcdoc');return;} frame.setAttribute('srcdoc',code); var st=heStats(code); box.innerHTML='

'+citT('res_stats',{chars:st.chars,lines:st.lines})+'

';box.classList.add('show'); } var heTimer=null; document.getElementById('heCode').addEventListener('input',function(){clearTimeout(heTimer);heTimer=setTimeout(heRender,400);}); document.getElementById('heRender').addEventListener('click',heRender); document.getElementById('heSample').addEventListener('click',function(){document.getElementById('heCode').value=heSample();heRender();}); document.getElementById('heClear').addEventListener('click',function(){document.getElementById('heCode').value='';heRender();}); document.getElementById('heCopy').addEventListener('click',function(){ var box=document.getElementById('result');var code=document.getElementById('heCode').value; if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(code).then(function(){box.innerHTML='

'+citT('res_copied')+'

';box.classList.add('show');},function(){box.innerHTML='

'+citT('res_copy_fail')+'

';box.classList.add('show');});} else{box.innerHTML='

'+citT('res_copy_fail')+'

';box.classList.add('show');} }); document.getElementById('heDownload').addEventListener('click',function(){ var code=document.getElementById('heCode').value; if(!code.trim()){var box=document.getElementById('result');box.innerHTML='

'+citT('res_empty')+'

';box.classList.add('show');return;} var blob=new Blob([code],{type:'text/html;charset=utf-8'}); var a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='page.html';document.body.appendChild(a);a.click(); setTimeout(function(){URL.revokeObjectURL(a.href);a.remove();},500); }); document.getElementById('heCode').value=heSample(); heRender();