title: find the id of the next element present in next div-jquery
body: <p>My form has number of input elements. When i looping through some elements i need to find the <code>id</code> of the next element which is in next div.</p>
  
  <p>The whole code is in <a href="http://jsfiddle.net/95rqY/61/" rel="nofollow">jsfiddle</a>  </p>
  
  <pre><code> $(":text[name^=sedan]").each(function(i){
  var curTxtBox = $(this);
  var curId = this.id;
  alert(curId);   
      //var nextTextFieldId = $(this).closest('div').find('.number').attr("id");   // gives undefined
      var nextTextFieldId = $('#'+curId).next('div:input[type=text]').attr("id");   // gives undefined
     alert(nextTextFieldId ) 
  
  });
  </code></pre>
  
  <p>this is not working. <code>nextTextFieldId</code> gives value undefined.</p>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;div class="first"&gt;
      &lt;div class="second"&gt;
         &lt;input type="text" class ="myClass" name="sedan1" id = "sedan1"  value="1"  /&gt; 
      &lt;/div&gt;
      &lt;div class="third"&gt;
         &lt;input type="text" class ="yourClass" name="suv1" id ="suv1" value="2"/&gt; 
     &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="first"&gt;
    &lt;div class="second"&gt;
        &lt;input type="text" class ="myClass" name="sedan2" id = "sedan2"  value="3"  /&gt; 
     &lt;/div&gt;
  
     &lt;div class="third"&gt;
      &lt;input type="text" class ="yourClass" name="suv2" id = "suv2"  value="" /&gt;
    &lt;/div&gt;        
  &lt;/div&gt;
  </code></pre>