cnsgithub / nicecountryinput

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:HTML 76.8%Language:CSS 23.2%