<script src="js/code_js.js" type="text/javascript"></script> <script> function count_remaining_character() { var max_length = 200; var character_entered = $('#text_container').val().length; var character_remaining = max_length - character_entered; $('#character-count').html(character_remaining); if(max_length < character_entered) { $('#character-count').css('color','#FF0000'); } else { $('#character-count').css('color','#d0d0d0'); } } </script>
<style type="text/css"> #text_container { padding:10px; border:red 1px solid; border-radius:4px; background-color:#FFF; cursor:pointer; font-size:18px; width:500px; } #text_container:focus { outline: 0; } #character-count { color: #A0A0A0; padding: 15px 0px; } </style>