How to decode HTML entities using jQuery?

后端 未结 19 2519
忘了有多久
忘了有多久 2020-11-21 23:21

How do I use jQuery to decode HTML entities in a string?

19条回答
  •  野性不改
    2020-11-21 23:56

    You have to make custom function for html entities:

    function htmlEntities(str) {
    return String(str).replace(/&/g, '&').replace(//g,'>').replace(/"/g, '"');
    }
    

提交回复
热议问题