A few tricks to make my coding a bit better
<p>Hi guys I'm tired of writing long lines of code and would like a few more tricks under my belt to shorten my coding, so any suggestions regarding this bit of code would be great:   </p>

<pre><code>if(data.elec_supplier_error == 1) {
   $("#elec_supplier").nextAll('.errorimg').eq(0).css('display', 'inline');     
   $("#elec_supplier").nextAll('.error').eq(0).css('display', 'inline');                
} 
if(data.elec_plan_error == 1) {
   $("#elec_plan").nextAll('.errorimg').eq(0).css('display', 'inline');
   $("#elec_plan").nextAll('.error').eq(0).css('display', 'inline');                
}  
if(data.elec_payment_error == 1) {
   $("#elec_payment").nextAll('.errorimg').eq(0).css('display', 'inline');
   $("#elec_payment").nextAll('.error').eq(0).css('display', 'inline');             
}  
if(data.elecrad_error == 1) {
   $("#sam4").html("sadsadsadadadad");  
   $("#elecyes").prevAll('.errorimg').eq(0).css('display', 'inline');
   $("#elecyes").prevAll('.error').eq(0).css('display', 'inline');  
   $("#elecyes").prevAll('.text').eq(0).css('display', 'inline');
   $("#elecyes").prevAll('.displayelecradhack').eq(0).show();
   $("#elecyes").prevAll('.displayelecradhack2').eq(0).show();
} 
</code></pre>

<p>Thanks for your help
Sam</p>
