Check if checkbox or radio button inside div is seleted
<p>Using jQuery I want to check if checkboxes or radio button inside a div tag is selected and get the value of selected checkbox and radio buttons.</p>

<p>For Example:</p>

<pre><code>     &lt;div&gt;
        Question
        &lt;div&gt;
            What is your name?
        &lt;/div&gt;
        &lt;div&gt;
            &lt;input type="radio" name="r1" checked/&gt;abc&lt;br/&gt;
            &lt;input type="radio" name="r1"/&gt;pqr&lt;br/&gt;
            &lt;input type="radio" name="r1"/&gt;lmn&lt;br/&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div style="visibility: hidden"&gt;
        Question
        &lt;div&gt;
            What is your company name?
        &lt;/div&gt;
        &lt;div&gt;
            &lt;input type="checkbox" name="c1" checked/&gt;comp1&lt;br/&gt;
            &lt;input type="checkbox" name="c1"/&gt;Comp2&lt;br/&gt;
            &lt;input type="checkbox" name="c1"/&gt;Comp3&lt;br/&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>on button click I want to show question and in front of that the answer of that question. Like as follows</p>

<p>What is your name =   abc</p>

<p>What is your company name = comp1, comp2</p>

<p>Thanks.</p>
