Selecting in the Input Field in JS

I would like to select the text that was entered in the input field without using jQuery or any other library. Only using Vanilla JS. The goal is to check whether the word was fully selected. If it is only part of the word, in the console will be outputed the responsive message, that is isn`t still full word. But after achieving full word, will be outputed responsive message

<form id="login">
    <div class="form-group">
        <label for="username">Username</label>
        <input id="username" type="text" name="username">
    </div>
</form>