title: How to add an onclick event to a joint.js element?
body: <p>I have a joint.js element in a DAG, and would like to be able to trigger an event by clicking on it.</p>
  
  <p>I could use <code>$(selector).click(...)</code> to do it, but I was wondering if there was a joint.js specific way of handling it,
  since that would probobly be better. One event I decided was a candidate for onclick was 'batch:stop'</p>
  
  <p>My code:</p>
  
  <pre><code> var variable =  new joint.shapes.basic.Rect({
       name : label,
       id: label,
       onclick : function () {alert("hello");},
       size: { width: width, height: height },
       attrs: {
           text: { text: label, 'font-size': letterSize, 'font-family': 'monospace' },
           rect: {
               fill : fillColor, 
               width: width, height: height,
               rx: 5, ry: 5,
               stroke: '#555'
           }   
       }   
   }); 
   variable.on('batch:stop', function (element) {alert(""); toggleEvidence(element.name);});
   return variable;
  </code></pre>
  
  <p>How should I add an onclick event?</p>