Getting the next textbox using the next() function in jquery
<p>I am trying to write some Jquery code that will get the value of the next textbox that is of a class "in". The code I have here isn't working, the value is always undefined. I think I am using the next() function incorrectly but I am not sure, does anybody have any input?    </p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;body&gt;
&lt;input type="text" class="mm" /&gt;
&lt;br&gt;
&lt;input type="text" class="in" /&gt;  

$(document).ready(function() {
    $("input").focus(function() {

        var value = $(this).next(".in").val();
        if (value) {
            alert(value);
        }

    });
});   

  &lt;/script&gt;
 &lt;/body&gt;
&lt;/html&gt;
</code></pre>
