What does `this` refer to in an addEventListener callback? - closed
<p>This function does not work..can't figure out why...no errors...but the image does not shrink when I click it.</p>

<pre><code>image_element.addEventListener( "click", function( )
{ 
    this.style.width = ( parseInt( this.style.width ) - 1 ) + 'px';
    this.style.height = ( parseInt( this.style.height ) - 1 ) + 'px';
}, false );
</code></pre>

<p><strong>Full Code</strong></p>

<pre><code>function initOrbs()
{
    var image_element;
        image_element = document.createElement( 'img' );
        image_element.className = "orb";
        image_element.id = icon_array[ initOrbs.index ];
        image_element.speed = icon_array[ initOrbs.index + 1 ];
        if(image_element.speed  &gt; 10000 )
        {
            image_element.speed  = image_element.speed / 10;
            image_element.style.width = '20px';
            image_element.style.height = '20px';
        }
        else
        {
            image_element.style.width = '16px';
            image_element.style.height = '16px';
        }
        image_element.src = '/develop/foo/favicons/' + icon_array[ initOrbs.index ];  
        image_element.style.top = '-80px';
        image_element.style.left = random( 100, 800) + 'px';
        sky.appendChild( image_element );
        image_element.addEventListener( "click", function( )
        { 
            this.style.width = ( parseInt( this.style.width ) - 1 ) + 'px';
            this.style.height = ( parseInt( this.style.height ) - 1 ) + 'px';
        }, false );
        moveLinear( image_element );
        initOrbs.index += 2;
}
</code></pre>
