title: Selecting next input field (jQuery)
body: <p>I have a jQuery UI slider. All works great using this code:</p>
  
  <p><strong>Form</strong></p>
  
  <pre><code>&lt;div class="ui-slide" id="test_div" min="1" max="20" inc="1"&gt;&lt;/div&gt;
  &lt;input readonly="readonly" name="padding" id="padding" type="text" value="5" /&gt;
  </code></pre>
  
  <p>This is the JavaScript code that I use to get the value of the textfield:</p>
  
  <p><strong>JS Code</strong></p>
  
  <pre><code>$('div.ui-slide').each(function(i){
  
      if( $(this).attr('min') != undefined &amp;&amp; $(this).attr('max') != undefined ) {
  
          $(this).slider( { 
                          min: parseInt($(this).attr('min')), 
                          max: parseInt($(this).attr('max')), 
                          value: parseInt($(this).next("input").val()),
                          step: parseInt($(this).attr('inc')) ,
                          slide: function( event, ui ) {
                              $( this ).next("input").val(ui.value);
                          }
                      });
  
          $(this).removeAttr('min').removeAttr('max').removeAttr('inc');
  
      }
  
  });
  </code></pre>
  
  <p><strong>The Issue:</strong></p>
  
  <p>I need to place both the slider and the textfield inside a table, specifically each in there own "td". When I do this I can no longer retrieve the values of the textfield using the above JS code.</p>
  
  <pre><code>&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;
  &lt;td&gt;&lt;div class="ui-slide" id="test_div" min="1" max="20" inc="1"&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input readonly="readonly" name="padding" id="padding" type="text" value="5" /&gt;&lt;/td&gt;
  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
  </code></pre>
  
  <p>Chrome development tools gives me this error.</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot call method 'addClass' of undefined</p>
  </blockquote>
  
  <p>I figured it has to do with this line of code:</p>
  
  <pre><code>value: parseInt($(this).next("input").val()),
  </code></pre>
  
  <p>I am unsure though how to get the value of the next "input" once it is inside a table cell.</p>