title: jQuery Drag and Drop using class selectors
body: <p>This must be a simple one for expert. I am new to JS/jQuery. I have got a script to drag and copy and I modified it according to my requirements. It is implemented with "id" selectors. I want to implement the same using "class" selectors.</p>
  
  <p>Here is the <a href="http://jsfiddle.net/2no0f7db/" rel="nofollow">fiddle demo</a></p>
  
  <pre><code>$(document).ready(function(){
  $('#arsenal').on("dragstart", ( function (e) {
      e.originalEvent.dataTransfer.setData("Text", e.target.id);
  }));
  
  $('#leftbox').on("dragenter", ( function (e) {
      e.preventDefault();
  }));
  
  $('#leftbox').on("dragover", ( function (e) {
      e.preventDefault();
  }));
  
  $('#leftbox').on("drop", ( function (e) {
      e.preventDefault();
      $(this).empty();
      var data=e.originalEvent.dataTransfer.getData("Text");
      var nodeCopy = document.getElementById(data).cloneNode(true);
      nodeCopy.id = "newId";
      e.target.appendChild(nodeCopy);
  }));
  
  });
  </code></pre>
  
  <p>Explanation:
  I have a requirement where I need to implement this for a set of images which are dynamically added(with JS). So I cannot use Id of the target images. I need to use class. I tried but couldn't get it working.
  Can anyone help me with this?</p>
  
  <p>Thanks in advance, </p>