title: How to show Selected value from dropdown inside table in dot net core mvc with jquery
body: <pre><code>'''
  $.ajax({
              type: &quot;POST&quot;,
              url: '@Url.Action(&quot;GridData&quot;, &quot;PeriodOpenclose&quot;)/',
              dataType: &quot;json&quot;,
                success: function (response) {
                    debugger
                  if (response.data.length &gt; 0) {
                      $.each(response.data, function (i, List) {
                          var newRow = $(&quot;&lt;tr&gt;&quot;);
                          var cols = &quot;&quot;;
  cols += '&lt;td&gt; &lt;select id=&quot;dropdowntype&quot;  class=&quot;form-control&quot;&gt;&lt;option value=&quot;1&quot;&gt;Open &lt;/option&gt; &lt;option value=&quot;2&quot;&gt;Close &lt;/option&gt;&lt;/select &gt;&lt;/td &gt; ';
                          $(&quot;#dropdowntype&quot;).val($(&quot;#dropdowntype option:selected&quot;).val(List.periodstatus));
  '''
  </code></pre>
  <p>I added this  inside table i have added select tag and Manually option is added. i am selecting value 2 in List.periodstatus,i am unable to display selected value in dropdown.</p>