Skip to content

Instantly share code, notes, and snippets.

@starx
starx / Javascript ISO Country Lists for Select2 Plugin
Last active June 22, 2020 12:57 — forked from maephisto/Javascript ISO country code to country name conversion
ISO 3166-1 alpha-2 country code to country name conversion with a implementation for Select2 plugin [Demo 1: http://jsfiddle.net/Starx/sgb4888k/1/, Demo 2 (With flags): http://jsfiddle.net/Starx/sgb4888k/2/]]
(function($) {
$(function() {
var isoCountries = [
{ id: 'AF', text: 'Afghanistan'},
{ id: 'AX', text: 'Aland Islands'},
{ id: 'AL', text: 'Albania'},
{ id: 'DZ', text: 'Algeria'},
{ id: 'AS', text: 'American Samoa'},
{ id: 'AD', text: 'Andorra'},
{ id: 'AO', text: 'Angola'},