HTML :
<div id="target" />
<div id="source"><p>bla bla bla</p></div>
Content replacement via normal javascript :
document.getElementById("target").innerHTML = document.getElementById("source").innerHTML;
Content replament via jQuery :
$("#target").html($("#source").html());
You can bind this code to a link by adding the onclick method to the link and wrapping it in a function (normal JS) or via the different methods of jQuery (on, click).
Example JS:
<a id="copytext" href="#" onclick='copyText();return false'>Copy text</a>
<script>
function copyText() {
document.getElementById("target").innerHTML = document.getElementById("source").innerHTML;
}
</script>
Example jQuery :
<script>
$(function() {
$("#copyref").click(function(e) {
e.preventDefault();
$("#target").html($("#source").html());
});
})
</script>