I'm getting the previous value in console when i write in the input, how can i get the actual value?
const input1 = document.querySelector('#a')
input1.addEventListener('keypress', (e) => {
console.log(e.target.value)
})
<input type="text" id="a" />
