Universeorange.com/Docs/

Priya library Function reference Element functions htmlspecialchars

    ready(() => {
        let element = select('#root');
        element.html('<h1>Hello World!</h1>');
        console.log(element.htmlspecialchars(element.html(), 'ENT_QUOTES'));
        //&lt;h1&gt;Hello World!&lt;/h1&gt;
        element.html("ab\"c'd");
        console.log(element.htmlspecialchars(element.html(), ['ENT_NOQUOTES', 'ENT_QUOTES']));
        //ab"c&#039;d
    });

Htmlspecialchars transform special chars in html to their entities.

Last modified: 2021-06-07

© 2021 universeorange.com