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
AVADHESH PATEL
29-Jan-2013Hi John Rob!
You just overwrite your jquery code with below code