How to do this simple set of nearly identical js without so much repeating?
<p>I'm trying to learn DRY coding and wondering how to do this sort of thing with a lot less code.</p>

<p>ie I have something like this:</p>

<pre><code>var option_shipping = $('#option_shipping div.selected .tag').text(),
    option_payment = $('#option_payment div.selected .tag').text(); 

if(option_shipping.length &lt; 1) {

    error = 1;  

    $('.option_shipping_wrap').addClass('attention');

}

if(option_payment.length &lt; 1) {

    error = 1;

    $('.option_payment_wrap').addClass('attention');

}
</code></pre>

<p>What is the most minimal way something like this can be done?</p>
