$("textarea").each(function() {
var text = $(this).text();
text = text.replace("http", "https");
$(this).text(text);
String.prototype.replaceAll = function(searchStr, replaceStr) {
var str = this;
// escape regexp special characters in search string
searchStr = searchStr.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
return str.replace(new RegExp(searchStr, 'gi'), replaceStr);
};
// usage:
str.replaceAll('hello', 'hi');