title: jQuery/Javascript temporarily disable events attached by addEventListener/attachEvent
body: <p>Is there a way to temporarily disable an event listener?</p>
  
  <p>In my case, I have a <em>third party library</em> (<strong>not</strong> jQuery centric) that creates mouseover/mouseout events on an element using <strong>addEventListener/attachEvent</strong>. </p>
  
  <p>Under certain circumstances another event fires on a different element and I need to disable those event listeners. My solution thus far has been to simply <code>unbind</code> the mouseover/mouseout. This <em>usually</em> works fine because that event generally causes the page to refresh.</p>
  
  <p>However, every now and again an error can occur (think validation error) that results in the page not refreshing, and I need to re-attach the mouseover/mouseout event listeners.</p>
  
  <p><strong>Helpful information</strong></p>
  
  <p>It's probably worth mentioning that because the mouseover/mouseout event listeners are created and attached within a third party library I cannot simply assign the event to a variable and bind/unbind it in that manner (which AFIK is the best way to do this).</p>
  
  <p><strong>Update</strong></p>
  
  <p>I had originally asked</p>
  
  <blockquote>
    <p>Is there a way in jQuery to get the event listeners already assigned to an object?</p>
  </blockquote>
  
  <p>I have since found out it is impossible to access events assigned by addEventListener/attachEvent: <a href="https://stackoverflow.com/questions/681120/access-events-added-with-attachevent-addeventlistener-in-javascript">Access events added with attachEvent() / addEventListener() in JavaScript</a></p>