jQuery: More elegant if/else with selectors
<p>I spit out this type of code frequently:</p>

<pre><code>if ($(this).val() == 'X') { $('#something').show(); }
else                      { $('#something').hide(); }
</code></pre>

<p>I'm not crazy about having $('#something') appear twice. Is there a more elegant way of expressing this? </p>

<p>[Update] I phrased the question badly - I'm looking for a general solution, not just show/hide (and therefore toggle). For the general case of taking different actions on a selected element(s) based on a conditional, is there a more elegant construct?</p>
