javascript/jquery- parsing through all elements of a radio/check box- how to get text value of each element
<p>I am trying to parse through a checkbox/radio button.</p>

<p>As an example let us consider the html code for a radio button below--</p>

<pre><code>&lt;br/&gt;&lt;br/&gt;Lunch-
&lt;input type="radio" name="lunch" value="pasta1" /&gt; Pasta
&lt;input type="radio" name="lunch" value="rissotto1" /&gt; Rissotto
&lt;br/&gt;
</code></pre>

<p>Now I am using the following code to obtain both the text value shown on screen (eg "Pasta") as well as the value assigned (eg "pasta1")--</p>

<pre><code>$(jQuery('input[type="radio"], input[type="checkbox"] ', $(element).parent('form'))).each(function() 
{
                    alert(" Text values =" + $(this).text());
                    alert(" actual values =" + $(this).val());
                                    ---SOME MORE CODE---
}
</code></pre>

<p>As output, I am not getting any value when I use $(this).text(), although $(this).val() works fine.</p>

<p>How do I get the text values for each element of a radio button/check box... Something that I can use in place of the $(this).text() used above? Is there some other way to obtain the text value (eg "Pasta" or "Risotto" for the example above)?</p>
