Problem with putting in the right parameters
<p>I have problem with putting in the right parameters from an eventListener into a function.</p>

<pre><code>  &lt;!DOCTYPE html&gt;
   &lt;html&gt;
    &lt;head&gt;
     &lt;title&gt;&lt;/title&gt;
     &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;script type="text/javascript"&gt;         

           window.onload = function() {
            var galleryContainer = document.getElementById('galleryContainer');
            var image = galleryContainer.getElementsByTagName('div');
            //console.log(image);

            var images = new Array();
            images.push(image);

            for(var i = 0; i &lt; images[0].length; i++) {
                images[0][i].addEventListener('click', function() {showImage(this)
                }, false);
               };
           }
    // I dont know with parameter to put into showImage() from the listener.
           function showImage( here is the problem ) {

            var preview = document.getElementById('preview');
            preview.innerhtml = image.innerhtml;
   // I want to put the image into the preview element.

          }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div id="galleryContainer"&gt;
        &lt;div&gt;trams&lt;/div&gt;
        &lt;div&gt;trams&lt;/div&gt;
        &lt;div&gt;trams&lt;/div&gt;
        &lt;div&gt;trams&lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="preview" style="width: 200px; height: 200px; border: 1px solid red"&gt;&lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p></p>
