JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="username" />

JavaScript

$(document).ready(function() {
    $('input#username').keypress(function() {
        var _this = $(this); // copy of this object for further usage
        
        setTimeout(function() {
            alert(_this.val());
        }, 3000);
    });
});