How can I replace html parts with replace()?
replace()
google.com >
google.com
Make your pattern global by using the g switch:
g
var e = $("div"), fix = e.html().replace(/google.com/g, "duckduckgo.com"); e.html(fix);
jsFiddle example
This way it replaces the link and the text.