Skip to content

Javascript country selection made easy... No NPM, No Images, just one JS file, one CSS file

Notifications You must be signed in to change notification settings

masbaehr/nicecountryinput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to nicecountryinput

An easy-to-use country picker. Just 1 JS and 1 CSS file.

Show Demo!

Usage:

    <script src="niceCountryInput.js"></script>
    <link rel="stylesheet" type="text/css" href="niceCountryInput.css">

    <div id="testinput" style="width: 300px;" data-selectedcountry="US" data-showspecial="false"
        data-showflags="true" data-i18nall="All selected" data-i18nnofilter="No selection" 
        data-i18nfilter="Filter" data-onchangecallback="onChangeCallback">
    </div>

    <script>
        function onChangeCallback(ctr){
            console.log("The country was changed: " + ctr);
        }
        document.addEventListener("DOMContentLoaded", function(event) { 
            document.querySelectorAll(".niceCountryInputSelector").forEach(element => new NiceCountryInput(element).init());
        });
    </script>

About

Javascript country selection made easy... No NPM, No Images, just one JS file, one CSS file

Resources

Stars

Watchers

Forks

Packages

No packages published