forum

Home / DeveloperSection / Forums / Keyup event not fired in JQuery

Keyup event not fired in JQuery

Anonymous User 4097 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


Updated on 29-Jan-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By