# How do I get the target in javascript?

**URL:** <https://forum.kirupa.com/t/how-do-i-get-the-target-in-javascript/331587>\
**Category:** web dev\
**Created:** [September 5, 2013, 9:22am UTC](https://forum.kirupa.com/t/how-do-i-get-the-target-in-javascript/331587 "2013-09-05T09:22:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lnsiu](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lnsiu](https://forum.kirupa.com/u/lnsiu)\
**Post date:** [September 5, 2013, 9:22am UTC](https://forum.kirupa.com/t/how-do-i-get-the-target-in-javascript/331587/1 "2013-09-05T09:22:44Z")

</div>

I’m trying to get the target in a mouseevent.  
I seem not able to use addEventListeners?

all I get is htmlacanvasobject and object Object.

This is my code so far, now where is my buttontarget?

```auto

    for(var i=0; i< buttonArr.length;i++)
    {
        //alert("more");
        buttonArr*.id = i;
        buttonArr*.on('mouseup', function(evt){
            alert("target: " + evt.target);
            alert(this);
        });
    }

```
