how to clear inputs in a form javascript code example Example: how to reset input field in javascript document.querySelector('#counter').value = '';