jQuery实现PHP的htmlspecialchars的功能
var mytext = "<hello http://tool.lu>"; $("<div/>").text(mytext).html();