https://github.com/ahmetaksungur/akstelephoneinput
International Telephone Numbers
https://github.com/ahmetaksungur/akstelephoneinput
input international international-telephone international-telephone-numbers tel telephone telephone-number
Last synced: 4 months ago
JSON representation
International Telephone Numbers
- Host: GitHub
- URL: https://github.com/ahmetaksungur/akstelephoneinput
- Owner: Ahmetaksungur
- License: mit
- Created: 2021-05-23T14:46:58.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-12T07:11:21.000Z (over 4 years ago)
- Last Synced: 2025-04-12T18:44:59.786Z (7 months ago)
- Topics: input, international, international-telephone, international-telephone-numbers, tel, telephone, telephone-number
- Language: JavaScript
- Homepage: https://codepen.io/collection/pggzPE
- Size: 1.65 MB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aksTelephoneInput.js
International Telephone Numbers
**[View the Demo on CodePen →](https://codepen.io/collection/pggzPE)**

## Getting Started
Compiled and production-ready code can be found in the `dist` directory.
### 1. Include aksTelephoneInput.min.js on your site.
**Direct Download**
You can [download the files directly from GitHub](https://github.com/Ahmetaksungur/akstelephoneinput/archive/main.zip).
```html
```
```html
```
**CDN**
```html
```
```html
```
---
```html
```
```html
```
**jQuery**
```html
```
---
**NPM**
```bash
npm i akstelephoneinput
```
## Document aksTelephoneInput.js
```html
```
```js
$("#tel").aksTelephoneInput({
valueNumberCode: false,
flagsUrl: "https://unpkg.com/akstelephoneinput@1.0.1/flags/"
});
```
[Sample](https://codepen.io/ahmetaksungur/pen/abJwOzz).
### Auto Country
```js
$("#tel").aksTelephoneInput({
valueNumberCode: false,
autoCountry: true,
geoCountries: function (callback) {
$.get("https://ipwhois.app/json/", function (data) {
callback(data.country_code);
});
},
flagsUrl: "https://unpkg.com/akstelephoneinput@1.0.1/flags/"
});
```
[Sample](https://codepen.io/ahmetaksungur/pen/ExWXjPa).
### Change Country
```js
$("#tel").aksTelephoneInput({
valueNumberCode: false,
changeCountry: function () {
console.log(this);
},
flagsUrl: "https://unpkg.com/akstelephoneinput@1.0.1/flags/"
});
```
[Sample](https://codepen.io/ahmetaksungur/pen/WNpOvwg).
### Attributes
```js
allCountries: [],
onlyCountries: [],
primaryCountries: [],
currentCountries: "",
autoCountry: false,
geoCountries: function (callback) {
$.get("https://ipwhois.app/json/", function (data) {
callback(data.country_code);
});
},
changeCountry: function () {},
placeholderNumber: true,
valueNumberCode: false,
searchBar: true
```
## License
The code is available under the [MIT License](https://github.com/Ahmetaksungur/akstelephoneinput/blob/main/LICENSE).