Users Pricing

forum

Home Forums Keyup event not fired in JQuery – MindStick

Keyup event not fired in JQuery

Anonymous User 4588 29 Jan 2013

Hi! Everyone!

Keyup event is not fire properly:
I am working with the Keyup method of jQuery and it doesn't seem to work for me. below is my code and please find out the problem and reslove.

My code is below

 <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
    <script>
      $('#TAcomments').keyup(function() {
        var textCount = $(this).val().length;
        if(textCount <= 10) {
          $('#TAcomments').stop().animate({ fontSize : '22px' });
        }
        if(textCount > 10) {
          $('#TAcomments').stop().animate({ fontSize : '16px' });
        }
        if(textCount > 20) {
          $('#TAcomments').stop().animate({ fontSize : '14px' });
        }
        if(textCount > 30) {
          $('#TAcomments').stop().animate({ fontSize : '10px' });
        }
      });
    </script>

HTML code

 <textarea id="TAcomments" style="width: 400px; height: 300px; font-size: 22px;"></textarea>

Can you help me?

Thanks in advance


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md