jQuery两句话实现HTML转义与反转义

内容纲要
$('<div>').text('<a>').html()
结果:&lt;a&gt;

$('<div>').html('&lt;a&gt;').text()
结果:<a>

发表回复