Joe Clifford Joe Clifford - 1 year ago 112
HTML Question

Clear Input Box Every x Seconds

I'd like to know how to clear a text box every 'x' seconds using JavaScript (or whatever's best) in my HTML/PHP iPad WebApp.

Any help is appreciated!

Answer Source

Vanilla javascript: clears input value every 3 seconds

  function() {
    document.getElementById("my-input").value = "";
  }, 3000);
<input id="my-input" type="text" />

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download