var str = "This is an Example"; alert(str.replace("Example", "Error"));
Example
Error
This is an Example
This is an Error