jQuery based way to render a select list of countries with a country flag
JavaScript CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



jQuery.Locale is a jQuery based way to render a select list of countries that will render the country flag next to the selected country. The flags used in this plugin are from Mark James and his FAMFAMFAM site.

working example shows simple selects with change flags. working example shows a select with a callback that sets a datepicker locate based on callback data.


Include jQuery and src/jquery.locale.js.


If you only want to render a specific list of flags, you can pass a list of flags in as an argument

    'flags' : [{'name' : 'United States', 'code': 'us', 'region': 'en'}, {'name' : 'Mexico', 'code': 'mx', 'region': 'es'}]


You can also trigger an event when a flag has been selected

    callback: function(flag) {


The following options are available: -showFlag - Default is true. Set to false if you don't want to render the flag. -selectedFlag - Set the selected flag in the select list. Default is U.S. -emptyIndex - Add an empty item to the select list as the first item. -flags - You can narrow down the number of flags by providing only the ones you want. -region - The default language for use in things like a datepicker. -callback - A funtction you want to call when the locale select has been changed. The selected flag is passed to your function.