title: Jquery select next text input value
body: <p>I have got  dynamic checkboxes along with corresponding text input's. What I'm trying to achieve is when a checkbox is checked that particular checkbox text input's value is alerted. I can't seem to get the value of the text input. At the moment all the checkboxes alert the value of the first textbox only instead of the right one. Also by default the text inputs should be hidden until a checkbox is clicked, which then shows the respective text field</p>
  
  <p><a href="http://jsfiddle.net/hpJMN/55/" rel="nofollow">http://jsfiddle.net/hpJMN/55/</a></p>
  
  <p>Above is a simple example of what Im trying  to achieve. </p>
  
  <pre><code> &lt;h3&gt;Checkbox Toggle input element&lt;/h3&gt;
  
  
  &lt;div class="equipment"&gt;
  
  &lt;/div&gt;
  
  
  printarr();
  </code></pre>
  
  <p>Script</p>
  
  <pre><code>$(".equipment input:checkbox").change(function () {
      alert($(this).siblings("input[type=text]").val());
  });
  
  function printarr() {
      for (var x = 0; x &lt; 4; x++) {
          $(".equipment").append(
              '&lt;input type="checkbox" name="drill_eq[]" value="' + x + '"&gt;&amp;nbsp;' + (x + 1) + '&amp;nbsp&lt;br&gt;' + '&lt;input type="text" name="qty" id="' + (x + 1) + '" title="Qty needed" size="1" maxlength="2"&gt;&lt;br&gt;');
      }
  }
  </code></pre>