self.makeDroppable = function(elements) { $(".txtDropTarget").droppable({ accept: "li", drop: function(ev, ui) { $(this).insertAtCaret(ui.draggable.text()).change(); } }); };