让后台原来转义的`` 换成`<` `>`, 就可以了: let htmlStr = `180<X<=360`; const parser = new DOMParser(); const html = parser.parseFromString(htmlStr, "text/html"); console.log(html); 