diff --git a/js/charcount.js b/js/charcount.js index 5c33b70b..d613392d 100644 --- a/js/charcount.js +++ b/js/charcount.js @@ -1,3 +1,4 @@ + /* * charcount.js * @@ -16,14 +17,17 @@ $(document).ready(function(){ var $coundownField = $('#countchar'); var $maxChars = 6001; + if ($inputArea.length == 0) + return; + // Preset countdown field to max initial content length - $coundownField.text($maxChars - $inputArea.length); + $('.countdown').text($maxChars - $inputArea.val().length); // input :: for all modern browsers [1] // selectionchange :: for IE9 [2] // propertychange :: for