Parse an HTML string with JS

后端 未结 10 1456
逝去的感伤
逝去的感伤 2020-11-21 07:17

I searched for a solution but nothing was relevant, so here is my problem:

I want to parse a string which contains HTML text. I want to do it in JavaScript.

10条回答
  •  孤城傲影
    2020-11-21 07:34

    let content = "

    404 Not Found

    " let result = $("
    ").html(content).text()

    content:

    404 Not Found

    ,
    result: "404 Not Found"

提交回复
热议问题