Skip to content

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

Notifications You must be signed in to change notification settings

cnsgithub/nicecountryinput

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 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 and jQuery dependency

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 76.8%
  • CSS 23.2%