Retrieving the Selected value dynamically in JQuery
<p>i have this html, this is generated dynamically based on question number </p>

<pre><code> &lt;fieldset id="selectfield"&gt;
            &lt;label class="select"&gt;What ur is Profession?
            &lt;/label&gt;
            &lt;br&gt;
            &lt;div class="ui-select"&gt;&lt;a href="#" role="button" id="72+_select-button" aria-haspopup="true" aria-owns="72+_select-menu" data-theme="c" class="ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-hover-c ui-btn-up-c"&gt;&lt;span class="ui-btn-inner ui-btn-corner-all" aria-hidden="true"&gt;&lt;span class="ui-btn-text"&gt;Business&lt;/span&gt;&lt;span class="ui-icon ui-icon-arrow-d ui-icon-shadow"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;

            &lt;select name="selectedObjects" id="72+_select" data-native-menu="false" tabindex="-1"&gt;
                &lt;option value="-1"&gt;--Select--&lt;/option&gt;
                    &lt;option value="769"&gt;Salaried&lt;/option&gt;
                    &lt;option selected="selected" value="770"&gt;Business&lt;/option&gt;
                    &lt;option value="771"&gt;Self Emp&lt;/option&gt;
            &lt;/select&gt;&lt;/div&gt;
        &lt;/fieldset&gt;
</code></pre>

<p>click button is</p>

<pre><code>     &lt;div data-theme="c" class="ui-btn ui-btn-corner-all ui-shadow ui-btn-hover-c ui-btn-up-c" aria-disabled="false"&gt;&lt;span class="ui-btn-inner ui-btn-corner-all" aria-hidden="true"&gt;&lt;span class="ui-btn-text"&gt;Next&lt;/span&gt;&lt;/span&gt;
        &lt;input type="submit" id="72+_b" onclick="return SaveDropDown(this);" value="Next" class="ui-btn-hidden" aria-disabled="false"&gt;
     &lt;/div&gt;
</code></pre>

<p>i have written this JS in SaveDropDown(this)</p>

<pre><code>       function SaveDropDown(button) { 
        var fieldsetName = getQuestionName(button.id)+'+_select'; 
        var select = $(fieldsetName +"option:selected").val(); 
        return false;
    }
</code></pre>

<p>the questionname function is</p>

<pre><code>     function getQuestionName(buttonid) { 
        var splitstr = buttonid.split('+');
        var fieldsetName = '#' + splitstr[0];
        return fieldsetName;
    }
</code></pre>

<p>but its returning the undefined how do i retrieve the select value dynamically.</p>

<p>any help is appreciated.</p>
