fullcalendar, deleting event on button click
<p>i am trying delete events when i click in button &quot;x&quot;, but not work, and not getting any error.</p>
<p>I assign the function click in parameter &quot;eventRender&quot;.</p>
<p>This is my code with JavaScript:</p>
<pre><code>$('#calendar').fullCalendar({
        locale: 'es',
        weekends: false, //ocultar fines de semana
        defaultView: 'agendaWeek',
        allDaySlot: false,
        header: {
            left: 'month,agendaWeek,agendaDay,listDay',
            center: 'title',
            right: 'prev,next today'
        },
        height: 'auto',
        minTime: &quot;10:00:00&quot;,
        maxTime: &quot;20:00:00&quot;,
        editable: true,
        //droppable: true, // this allows things to be dropped onto the calendar
        dayClick: function(date, jsEvent, view) {
            console.log('Clicked on: ' + date.format());
            console.log('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
            console.log('Current view: ' + view.name);
            var hoy = moment();
            if(date.format(&quot;YYYY-MM-DD HH:mm&quot;) &gt;= hoy.format(&quot;YYYY-MM-DD HH:mm&quot;)){
                asignarCita(date);
            }else{
                swal({
                    title: &quot;Cita no disponible&quot;,
                    text: &quot;La fecha u hora seleccionada ya ha pasado.&quot;
                });
            }
        },
        eventRender: function(event, element) {
            element.prepend( &quot;&lt;div class='ibox-tools'&gt;&lt;a style='background-color: transparent; margin-right: 10px' class='pull-left'&gt;&lt;i class='fa fa-times closeon'&gt;&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;&quot; );
            //element.append( &quot;&lt;span class='closeon'&gt;X&lt;/span&gt;&quot; );
            console.log(element.find('closeon'));
            element.find(&quot;.closeon&quot;).click(function() {
                $('#calendar').fullCalendar('removeEvents',event._id);
            });
        },
        events: [
            {
                title: 'All Day Event',
                start: '2014-10-01'
            },
            {
                title: 'Long Event',
                start: '2014-10-07',
                end: '2014-10-10'
            },
            {
                id: 999,
                title: 'Repeating Event',
                start: '2014-10-09T16:00:00'
            },
        ],
    });
</code></pre>
<p>Where is the problem?</p>