How to clear a textbox in JavaScript?

To clear a textbox in JavaScript, do this: textbox.value = ''.

For example, if this is your textbox:

<input id="textbox">

Then you can clear its value with this JavaScript:

document.getElementById('textbox').value = '';