Look for a character in a dynamic string and add or replace it with some other HTML
// break the string to a new line after a character $(".my-string:contains(':')").html(function () { return $(this).html().replace(":", "<br />"); });