close

Encode to HTML

jQuery('<div />').text('Some text with <div>html</div>').html()

 

Decode 

jQuery('<div />').html('Some text with &lt;div&gt;html&lt;/div&gt;').text()

資料來源 https://coderwall.com/p/jt7ysq/encode-string-to-html-entities-via-jquery

arrow
arrow
    全站熱搜

    浩瀚宇宙超級無敵 發表在 痞客邦 留言(0) 人氣()