clear textbox js code example Example: clear textbox js function name() { document.getElementById('elementid').value = ""; }