JSFiddle - React, Tailwind, and code Playground
HTML
<div id="field1"></div>
<div id="field2"></div>
JavaScript
var myProgram = (function() {
var paper1 = Raphael("field1", 200, 400, fieldActions);
var paper2 = Raphael("field2", 200, 400, fieldActions);
var planeAttrs = {
fill: "#f00"
};
function fieldActions(){
var that = this;
that.field = that.rect(0, 0, 200, 400, 10);
that.field.attr(planeAttrs);
that.field.mousedown( function(e) {
var target = e.target;
var svgElem = target.parentNode;
var div = svgElem.parentNode;
alert(div.id);
});
};
}());