title: Jquery Mobile - Add Option to Select Dynamically
body: <p>I have a JQM page with <code>select</code> element:</p>
  
  <pre><code>&lt;select class="state" name="user.state" data-role="select"&gt;&lt;option value=""&gt;state&lt;/option&gt;&lt;/select&gt;
  </code></pre>
  
  <p>Im trying to add option into it dynamically:</p>
  
  <pre><code>$.each(data['states'], function(index, state) {
      $('&lt;option value="'+state+'"&gt;'+state+'&lt;/option&gt;').appendTo($('#update-profile-page .state'));
  });
  </code></pre>
  
  <p>But it didn't worked as expected.</p>
  
  <p>Screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/rXTjq.png" alt="enter image description here"></p>
  
  <p>The problem is that the values of the default or selected option contains all the states.</p>