Raphael.el.cloneToPaper

Extension of Raphael to clone elements or paper on one to another.

HTML

<div id="paper1-container">Paper 1</div>
<div id="paper2-container">Paper 2</div>

JavaScript

var paper1, 
    paper2;

Raphael("paper1-container", 180, 80, function () {
    var paper = paper1 = this,
        rect = paper.rect(0.5, 0.5, 40, 40)
            .attr('fill', 'green')
            .click(function () {
                this.cloneToPaper(paper2);
            });
});

Raphael("paper2-container", 180, 80, function () {
    var paper = paper2 = this,
        rect = paper.rect(50.5, 0.5, 40, 40).attr('fill', 'red')
         this.cloneToPaper(paper1);
});