1
$('#element').bind({
    specialEvent : function()
    {
        console.log(1);
    }
});

How do I check whether the element has the specialEvent event or not?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
tomsseisums
  • 13,168
  • 19
  • 83
  • 145

1 Answers1

2

In jQuery 1.8 $(element).data('events') has been removed, but you can still get to the events data for debugging purposes via $._data(element, "events") - check this.

console.log($._data(element, 'events'));
jwaliszko
  • 16,942
  • 22
  • 92
  • 158