Created
December 4, 2015 17:18
-
-
Save avuenja/c483b1b59a150d253edc to your computer and use it in GitHub Desktop.
Coordenates "mask"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var coords = document.querySelectorAll('[data-coordenada]'); | |
var length = coords.length; | |
for (var i = 0; i < length; i++) { | |
coords[i].addEventListener('keyup', function(event) { | |
var value = this.value.replace(/[^\d-\.]/g, ""); | |
this.value = value; | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment