Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 0.29 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Is there a way in javascript to detect if an element has any events attached to it?
  2. jQuery(theElement).data('events');
  3.        
  4. $("element").data("events");
  5.        
  6. if(typeof document.getElementById("elementname").onchange === "function"){
  7. alert("has a function");
  8. } else {
  9. alert("no function");
  10. }