Created
October 8, 2013 01:05
-
-
Save juanbrujo/6877808 to your computer and use it in GitHub Desktop.
Simple character countdown
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 characterCountdown() { | |
var characterLeft = 140 - jQuery('textarea').val().length; | |
jQuery('.message').text(characterLeft + ' characters left.'); | |
} | |
$(function() { | |
characterCountdown(); | |
$('textarea').change(characterCountdown); | |
$('textarea').keyup(characterCountdown); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment