I'm trying to write an "unbreakable" class using jQuery, so that:
<span class=unbreakable>
some text in here
maybe with a <span title="tag">tag</span> or something
</span>
would have each space replaced with
. The problem is, if I do something like
$(".unbreakable").html
( replaceAll($(".unbreakable").html(), " ", " ")
);
It'll replace the spaces in tags as well - no good. So I'm looking for a way to avoid the tags without writing an html parser myself. Anyone know a good way to do this?