如何用jQuery替换DOM元素?

如下所示:

$target.replace('
test
')

 $(target).replaceWith('
test
');