I'm working on a multiselect plugin that uses only live events, and the way it works is the select element gets replaced by an input and div element. I would like to supply a callback function where the callback is tied to the input element. Is using the "data" method to store the callback the best way to proceed? Also, how should I handle the removal of the select element. Like this?
$.fn.myPlugin = function(options,callback) { this.each(function() { }).remove(); } or do I need to do this: mySelect.myPlugin().remove(); Thanks