Created
September 3, 2011 12:12
-
-
Save nathanpc/1191091 to your computer and use it in GitHub Desktop.
Field Character Counter
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
function textCounter(field, cntField, maxLimit) { | |
cntField.innerHTML = maxLimit - field.value.length; | |
if (field.value.length > 120) { | |
$("#label").css("color", "#ff0034"); | |
} else if (field.value.length > 100) { | |
$("#label").css("color", "#ff6025"); | |
} else { | |
$("#label").css("color", "#3e3e3e"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment