Tag:Text escape

  • HTML text escape tips

    Time:2021-12-5

    Today in CSDN to see a HTML text escape tips, very simple. 1. Use the function of DOM. First pass it to a DOM object as innerText, and then take the innerHTML attribute to get the escaped text. For example: div1.innerText = “<h1>title title….</h1>”; var str = div1.innerHTML; // “&lt;h1&gt;title title…” 2. Assuming that there […]