Apply function to specific elements
<p>I know this is elementary stuff, but I just can't figure it out...</p>

<p>How do I apply the css changes to multiple elements? At the moment, it's only working for the first, but showing no errors.</p>

<pre><code>function elemInit(){

    var elem1 = jQ('#elem1');
    var elem2 = jQ('#elem2');

    jQ(elem1, elem2).each(function(){
        jQ(this).css({
            'margin-left': '-' + jQ(this).width()/2 + 'px'
        });
    });

};

elemInit();
</code></pre>

<p><code>jQ</code> is to ensure there's no conflict.</p>
