title: Dollar Hash and variable - $('#
body: <p>So, to show and hide certain DIV tags within my site I got the following codes</p>
  
  <pre><code>$('#ONE').live('click', function () {
      $('.hide').css('display', 'none');
      $('#b-ONE').css('display', 'block');
  });
  $('#TWO').live('click', function () {
      $('.hide').css('display', 'none');
      $('#b-TWO').css('display', 'block');
  });
  </code></pre>
  
  <p>where a click on the div namend "ONE" opens a certain "b-ONE" div, and so on. It works flawlessly but is a pain when the list gets longer. You see where it says "ONE" and "TWO" in the JS ... is there any way I can turn these "ONE" and "TWO" into variables, so I can have up to 40 divs and don't have to type the above code for every DIV, and have a sleek code where I only have to type that finction once with variables?</p>
  
  <p>I'm looking into something like this but lack the in-depth JS / jQuery knowledge:</p>
  
  <pre><code>$('#VARIABLETEXT').live('click', function () {
      $('.hide').css('display', 'none');
      $('#b-VARIABLETEXT').css('display', 'block');
  });
  </code></pre>
  
  <p>Where a click on a div named "TWENTYONE" shows the div "b-TWENTYONE"</p>
  
  <p>Any help is highly appreciated!</p>