Created
September 22, 2015 21:40
-
-
Save jdavidbakr/33a7816eb9249f666d91 to your computer and use it in GitHub Desktop.
JavaScript: TextCountdown
This file contains hidden or 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 TextCountdown = { | |
Update: function(field, target_id) { | |
var maxlength = field.getAttribute('maxlength'); | |
var length = field.value.length; | |
var remaining = maxlength - length; | |
document.getElementById(target_id).innerHTML = remaining; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment