<input type="text" id= 'input'>
let input = document.getElementById('input');
//add event listener to keydown event
input.addEventListener('keydown',(e)=> {
console.log(e.key);
//check the key is 'Escape'
if( e.key === 'Escape') {
input.select();}
});
when I press 'Esc', it didn't work it only blur, don't select what I type in the input element. Where did I make mistake?