How to decode HTML entities using jQuery?

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

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

19条回答
  •  佛祖请我去吃肉
    2020-11-21 23:52

    Here are still one problem: Escaped string does not look readable when assigned to input value

    var string = _.escape("");
    $('input').val(string);
    

    Exapmle: https://jsfiddle.net/kjpdwmqa/3/

提交回复
热议问题