Due to circumstances out of my control, SharePoint, I have the following piece of code.
var item = $(\' <
Compare it to
, as that is the content you want to match. It appears not to be that because the browser renders is as space, rather than characters. Comparing it to
should result in either two sets of
s being compared, or two identical spaces being compared.
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/