How to get next input element id by using class in jquery?
<p>I have to get next textbox id on change event of the first textbox using jquery.
How can i get that. I have used next() for that but its not working as i wanted.</p>

<p>Here is my code,</p>

<pre><code>&lt;table&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;
                &lt;p&gt;PF Value&lt;/p&gt;&lt;br&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;span id="ctl00_ctl00_bcr_bcr_TextBox1" class="txtfill" style="display: inline-block;"&gt;
                    &lt;input name="ctl00$ctl00$bcr$bcr$TextBox1$textbox1" class="txtSec80CCD" value="0" id="ctl00_ctl00_bcr_bcr_TextBox1_textbox1" onblur="calcDedSecCCD(this)"  style="width: 70px;" type="text"&gt;
                    &lt;span id="ctl00_ctl00_bcr_bcr_TextBox1_valCustom" style="color: Red; display: none;"&gt;*&lt;/span&gt;
                    &lt;div id="ctl00_ctl00_bcr_bcr_TextBox1_ErrorDiv" class="ValidatorErrorDiv" style="display:none"&gt;
                        &lt;span id="ctl00_ctl00_bcr_bcr_TextBox1_Label1"&gt;You must enter a &lt;br&gt;number&lt;/span&gt;
                    &lt;/div&gt;
                &lt;/span&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;span id="ctl00_ctl00_bcr_bcr_TextBox2" class="txtfill" style="display: inline-block;"&gt;
                    &lt;input name="ctl00$ctl00$bcr$bcr$TextBox2$textbox1" class="txtSec80CCD" value="0" id="ctl00_ctl00_bcr_bcr_TextBox2_textbox1" style="width: 70px;" type="text"&gt;
                    &lt;span id="ctl00_ctl00_bcr_bcr_TextBox2_valCustom" style="color: Red; display: none;"&gt;*&lt;/span&gt;
                    &lt;div id="ctl00_ctl00_bcr_bcr_TextBox2_ErrorDiv" class="ValidatorErrorDiv" style="display:none"&gt;
                        &lt;span id="ctl00_ctl00_bcr_bcr_TextBox2_Label1"&gt;You must enter a &lt;br&gt;number&lt;/span&gt;
                    &lt;/div&gt;
                &lt;/span&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;
                &lt;p&gt;Life Insurance Premium&lt;/p&gt;&lt;br&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;span id="ctl00_ctl00_bcr_bcr_TextBox3" class="txtfill" style="display: inline-block;"&gt;
                    &lt;input name="ctl00$ctl00$bcr$bcr$TextBox3$textbox1" class="txtSec80CCD" value="0" id="ctl00_ctl00_bcr_bcr_TextBox3_textbox1" onblur="calcDedSecCCD(this)"  style="width: 70px;" type="text"&gt;
                    &lt;span id="ctl00_ctl00_bcr_bcr_TextBox3_valCustom" style="color: Red; display: none;"&gt;*&lt;/span&gt;
                    &lt;div id="ctl00_ctl00_bcr_bcr_TextBox3_ErrorDiv" class="ValidatorErrorDiv" style="display:none"&gt;
                        &lt;span id="ctl00_ctl00_bcr_bcr_TextBox3_Label1"&gt;You must enter a &lt;br&gt;number&lt;/span&gt;
                    &lt;/div&gt;
                &lt;/span&gt;
            &lt;/td&gt;
            &lt;td&gt;
                &lt;span id="ctl00_ctl00_bcr_bcr_TextBox4" class="txtfill" style="display: inline-block;"&gt;
                    &lt;input name="ctl00$ctl00$bcr$bcr$TextBox4$textbox1" class="txtSec80CCD" value="0" id="ctl00_ctl00_bcr_bcr_TextBox4_textbox1" style="width: 70px;" type="text"&gt;
                    &lt;span id="ctl00_ctl00_bcr_bcr_TextBox4_valCustom" style="color: Red; display: none;"&gt;*&lt;/span&gt;
                    &lt;div id="ctl00_ctl00_bcr_bcr_TextBox4_ErrorDiv" class="ValidatorErrorDiv" style="display:none"&gt;
                        &lt;span id="ctl00_ctl00_bcr_bcr_TextBox4_Label1"&gt;You must enter a &lt;br&gt;number&lt;/span&gt;
                    &lt;/div&gt;
                &lt;/span&gt;
            &lt;/td&gt;
        &lt;/tr&gt;

   ......
   ......
   ......

    &lt;/tbody&gt;
&lt;/table&gt;  
</code></pre>

<p>I have written my script like this,</p>

<pre><code>function calcDedSecCCD(id) {

        var eid = $(id).attr('id');
        //var elementVal = $('#' + eid).val();    
        //var nxtEid = $(eid).next(':input .txtSec80CCD').attr('id');            

        var nextele = $(this + ':input .txtSec80CCD').next();
        //alert(nextele);
        var nextId = $(nextele).attr('id');


        alert("First Element: "+eid);
        alert("First Element: " + nextId);

    }
</code></pre>

<p><img src="http://i.stack.imgur.com/kUD7k.jpg" alt="enter image description here"></p>

<p>I want textbox id : ctl00$ctl00$bcr$bcr$TextBox2$textbox1 on change event of textbox1.
How can i get the id of text input using class.
Or any other way to get id of next textbox on change of first one.    </p>
