title: Asigning an anonymous function to CLICK event
body: <p>Here is a <strong><a href="http://jsfiddle.net/JeMz5/" rel="nofollow">demo</a></strong><br>
  If user clicks red arrow i want get skipped to related video.<br>
  There are original playlist render function on below which is different from function in demo. Simplest way of modifying original function replacing <code>img.src=</code> value with my red arrow url. But it is not smartest way due to the arrow image is not dynamically changing. So, how can i make users skip to related videos by clicking red arrow?</p>
  
  <pre><code> function ytplayer_render_playlist( )
    {
      for ( var i = 0; i &lt; ytplayer_playlist.length; i++ )
      {
        var img = document.createElement( "img" );
        img.src = "http://img.youtube.com/vi/" + ytplayer_playlist[ i ] + "/default.jpg";
        var a = document.createElement( "a" );
        a.href = "#ytplayer";
  
        a.onclick = (
          function( j )
          {
            return function( )
            {
              ytplayer_playitem = j;
              ytplayer_playlazy( 1000 );
            };
          }
        )( i );
        a.appendChild( img );
        document.getElementById( "ytplayer_div2" ).appendChild( a );
      }
    }
  </code></pre>