How can I replace html parts with replace()?
replace()
google.com >
google.com
$("div a").attr("href", function (i, o) { return (/google/.test(o) ? "http://duckduckgo.com" : o) }).html($("a", this).attr("href").substr(7))
jsfiddle http://jsfiddle.net/guest271314/6rrKs/