jQuery - How to check if an element is an array or single
<p>Query 1.7.1</p>

<p>Sometimes I have an element as an array,  </p>

<pre><code>&lt;tr&gt;&lt;td&gt;&lt;input type="hidden" class="p" name="it" value="1"/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;input type="hidden" class="p" name="it" value="2"/&gt;&lt;/td&gt;&lt;/tr&gt;
</code></pre>

<p>The below jQuery code works,</p>

<pre><code>$(".p").each(function(i){
alert($('.p')[i].value);
});
</code></pre>

<p>Sometime I have that element as a single element</p>

<pre><code>&lt;tr&gt;&lt;td&gt;&lt;input type="hidden" class="p" name="it" value="1"/&gt;&lt;/td&gt;&lt;/tr&gt;
</code></pre>

<p>I want to make sure if the hidden input is an array or a single element before trying to execute the above jQuery code. How can I do that using jQuery?</p>
