DEV Community

Discussion on: Browser and React onChange event: The conundrum

Collapse
lukeshiru profile image
LUKESHIRU

You could just:

const input = document.querySelector("#dev");
const paragraph = document.querySelector(".curr-value");

input.addEventListener("input", ({ currentTarget }) => {
    paragraph.innerText = currentTarget.value;
});
Enter fullscreen mode Exit fullscreen mode
Collapse
kpulkit29 profile image
Pulkit Kashyap Author • Edited on

Yup agreed. Could have used that.