# How to check if listener already exists

**URL:** <https://forum.kirupa.com/t/how-to-check-if-listener-already-exists/250959>\
**Category:** Uncategorized\
**Created:** [February 4, 2008, 3:21am UTC](https://forum.kirupa.com/t/how-to-check-if-listener-already-exists/250959 "2008-02-04T03:21:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zubin101](https://avatars.discourse-cdn.com/v4/letter/z/51bf81/32.png) [@zubin101](https://forum.kirupa.com/u/zubin101)\
**Post date:** [February 4, 2008, 3:21am UTC](https://forum.kirupa.com/t/how-to-check-if-listener-already-exists/250959/1 "2008-02-04T03:21:19Z")

</div>

Hi, simple question: how do I check if a listener is (already) attached to an object using a if condition? Thanks!

eg;

object.addEventListener(MouseEvent.MOUSE\_DOWN, dothis);

if eventlistener MouseEvent.MOUSE\_DOWN exists on object then {  
object.removeEventListener(MouseEvent.MOUSE\_DOWN, dothis);  
}
