title: How to dynamically get the country code based on selected country
body: <p>Here is the piece of code that i am using. I have to show the country code automatically based on selected country by the user.</p>
  
  <p>I have a database which has both, the countries and corresponding country code.</p>
  
  <p>Now in the line where currently I am showing <strong>+91</strong>
   how can i put the logic to do the same ?</p>
  
  <p>Here is the code --</p>
  
  <pre><code>&lt;div class="phone-number-verify-widget"&gt;
    &lt;p class="pnaw-verification-error"&gt;&lt;/p&gt;
    &lt;div class="pnaw-step1"&gt;
      &lt;div class="phone-number-input-widget" id="phone-number-input-widget-d04854e1"&gt;
    &lt;label for="phone_country"&gt;Choose a country:&lt;/label&gt;
    &lt;div class="select"&gt;
      &lt;select id="phone_country" name="phone_country"&gt;
          &lt;option value="AF" data-prefix="93"&gt;Afghanistan&lt;/option&gt;
          &lt;option value="AD" data-prefix="376"&gt;....
          &lt;option value="ZW" data-prefix="263"&gt;Zimbabwe&lt;/option&gt;
      &lt;/select&gt;
    &lt;/div&gt;
  
    &lt;label for="phone_number"&gt;Add a phone number:&lt;/label&gt;
    &lt;div class="pniw-number-container clearfix"&gt;
      **&lt;div class="pniw-number-prefix"&gt;+91&lt;/div&gt;**
      &lt;input type="text" class="pniw-number" id="phone_number"&gt;
    &lt;/div&gt;
    &lt;input type="hidden" data-role="phone_number" name="phone" value="91"&gt;
    &lt;input type="hidden" name="user_id" value="19935817"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Kindly guide.</p>