更新时间:2021-12-25 14:54:51
尝试检查'\xa0'(这是 创建的字符):
'\xa0'
Try checking for '\xa0' (which is the character created by ):
var item = $("<span><font size=1> </font></span>").text(); alert("'" + item + "' " + (item == '\xa0'));
http://jsfiddle.net/hUBeP/3/
将jquery .text()匹配到& nbsp;