$(document).ready(function() { $("body").children().each(function() { $(this).html($(this).html().replace(/ /g," ")); }); });