Why shouldn't I make functions in a loop?
<p>Jshint.com suggests this for the code below:</p>

<pre><code>Line 150: }, false );

Don't make functions within a loop.
</code></pre>

<p>But, it allows me to not have to write document.getElementById() multiple times, instead I can save the ids in an array and loop through them.</p>

<p>More concise and maintainable code I feel.</p>

<pre><code>function styleTwitter( pair_array )
{
    var i, input, label;
    for ( i = 0; i &lt; pair_array.length; i+=2 ) 
    {
        input = document.getElementById( pair_array[ i ] );
        label = document.getElementById( pair_array[ i + 1 ] );

        input.addEventListener( "focus", function()
        { 
            if( input.value === '' )
            {
                label.style.opacity = 0; 
                input.style.border = '1px solid #888888'; 
            }
        }, false );

        input.addEventListener( "blur", function()
        {
            if( input.value === '' )
            {
                label.style.opacity = 1;
                new EffectsFont( label ).fade( 'up', 150 );
                input.style.border = '1px solid #dddddd'; 
            }

        }, false );
    }
</code></pre>
