Hi,

I have a jQuery event

$('#msg-text').keyup(function() {			
      $('#msg-chr-remaining').html('Remaining characters: '+(255-$('#msg-text').length));
});

The problem is it fires only once - the first time. Anyone knows why?

Thanks

Member Avatar for stbuchok

$('#msg-text').length

This refers to the length of the array that is returned from the jQuery object.

$('#msg-text').val().length

This refers to the length of the text from the textbox.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.