Why is .val() not a function?
<p>I have a dynamic form where the user provides a name and description:</p>

<pre><code>&lt;label&gt;Name&lt;/label&gt;&lt;br /&gt;
&lt;input type="text" name="name[]" maxlength="255" /&gt;&lt;br /&gt;

&lt;label&gt;Description&lt;/label&gt;&lt;br /&gt;
&lt;textarea name="desc[]"&gt;&lt;/textarea&gt;&lt;br /&gt;
</code></pre>

<p>I am trying to validate the form with Javascript to ensure that if the name is specified, then a description must be entered.</p>

<pre><code>$("input[name='name[]']").each(function() {
    var index = $("input[name='name[]']").index(this);
    if ($(this).val() != '') {
        alert($("textarea[name='desc[]']").get(index).value);
        alert($("textarea[name='desc[]']").get(index).val());
    }
}
</code></pre>

<p>The first alert() works as expected however with the second alert I get:
$("textarea[name='desc[]']").get(index).val() is not a function</p>

<p>What is the difference?  Why can't I use the jQuery function?</p>
