title: Add images with text in select2
body: <p>Well I am creating a select tag drop down with countries name as option and i want to add the respected countries flag with them:
  I used this HTML</p>
  
  <pre><code>    &lt;div class="form-group" id="abc"&gt;
          &lt;label class="col-md-2 control-label"&gt;Language: &lt;/label&gt;
      &lt;div class="col-md-6"&gt;
          &lt;select class="select2me form-control" name = "locale" id="select_lang"&gt;
              @foreach($languages as $lang)
                  &lt;option value="{{$lang-&gt;locale}}" @if($lang-&gt;locale == $company-&gt;locale) selected="selected" @endif&gt;{{$lang-&gt;language}}&lt;/option&gt;
              @endforeach
          &lt;/select&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>JAVASCRIPT USED:</p>
  
  <pre><code>    jQuery(document).ready(function() {
            $.fn.select2.defaults.set("theme", "bootstrap");
            $('.select2me').select2({
               placeholder: "Select",
               width: '100%',
               allowClear: false
             });
       function format(state) {
                  if (!state.id) return state.text; // optgroup
                  return "&lt;img class='flag' src='" + MyFILEPATH() + "flags/" + state.id.toLowerCase() + ".png'/&gt;&amp;nbsp;&amp;nbsp;" + state.text;
              }
              $("#select_lang").select2({
                  placeholder: "Select a Country",
                  allowClear: true,
                  formatResult: format,
                  formatSelection: format,
                  escapeMarkup: function (m) {
                      return m;
                  }
              });
      });
  </code></pre>