DEV Community

loading...

Discussion on: Amazing Clear Input Using HTML & JS

Collapse
adam_cyclones profile image
Adam Crockett

Here's another tip:

document.querySelector(".username").value = ''
Enter fullscreen mode Exit fullscreen mode

Nah just do this ☺️

document.querySelector(".username").clear();
Enter fullscreen mode Exit fullscreen mode