I'm using this search and replace jQuery script . I'm trying to put every character in a span but it doesn't work with unicode characters.
$("body").children().andSelf().contents().each(function(){
if (this.nodeType == 3) {
var $this = $(this);
$this.replaceWith($this.text().replace(/(\w)/g, "<span>$&</span>"));
}
});
Should I change the node type ? by what ?
thanks