My form has number of input elements. When i looping through some elements i need to find the `id` of the next element which is in next div.

The whole code is in [jsfiddle](http://jsfiddle.net/95rqY/61/) 

```
 $(":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 ) 

});

```

this is not working. `nextTextFieldId` gives value undefined.

**html**

```
<div class="first">
    <div class="second">
       <input type="text" class ="myClass" name="sedan1" id = "sedan1"  value="1"  /> 
    </div>
    <div class="third">
       <input type="text" class ="yourClass" name="suv1" id ="suv1" value="2"/> 
   </div>
</div>
<div class="first">
  <div class="second">
      <input type="text" class ="myClass" name="sedan2" id = "sedan2"  value="3"  /> 
   </div>

   <div class="third">
    <input type="text" class ="yourClass" name="suv2" id = "suv2"  value="" />
  </div>        
</div>

```