title: jQuery: How to get an id, manipulate it to select another id?
body: <p>Say I have the following:</p>
  
  <pre><code>&lt;input type="radio" class="trigger" id="some-id" /&gt;
  &lt;div id="some-id-target"&gt;…&lt;/div&gt;
  &lt;input type="radio" class="trigger" id="12345" /&gt;
  &lt;div id="12345-target"&gt;…&lt;/div&gt;
  </code></pre>
  
  <p>How do I write a general function to target the div from the input field id?</p>
  
  <p>This is what I am kind of thinking but not working:</p>
  
  <pre><code>$(document).ready(function() {    
      function toggleDiv() {
          var triggerBox = $(this).attr('id'),
              $targetBox = '$("#' + triggerBox + '-target")';
          $targetBox.toggle();
      }
  
      $('.trigger').on('change',toggleDiv);
  });
  </code></pre>
  
  <p>Hope this is clear and thank you in advance.</p>