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
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
$('#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.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.