ARTICLE AD BOX
I am trying to display the updated length of the input username by a user. I know that we can use .change() shorthand but it updates after the span has lost focus. I want something to update it immediatly. Just like the one I wrote down.
$('#username-input').focus(function(event) { $(event.target).css('background-color', 'yellow'); $(event.target).on('input', function() { var len = $(event.target).val().length; $('#username-feedback').text('Length: ' + len); }); });