I am building a simple JQuery widget. My widget builds appends a few items. I would like to know how to properly add event-functions to these newly added items from within the widget.
For example:
(function ($) {
$.widget('be.tagEditor', {
options: {
},
_init: function () {
var me = this;
createObj();
},
createObj: function() {
var me =this,
obj = me.element;
obj.append('<div class="example">');
}
});
})(jQuery);
If I had something like the above, what would be the proper way to add events to the div?