function albumName() { var text = $("#album_name").val(); var counter = text.length; $("#numtj var").text(counter); $(document).keyup(function() { var text = $("#album_name").val(); var counter = text.length; $("#name_word").text(counter); }); } }); </script>