“Wyczyść pole wejściowe” Kod odpowiedzi

Wyczyść fild wejściowy

document.getElementById('inpu').value = ''

<input type="text" onfocus="this.value=''" value="Blabla">
Xanthous Xenomorph

Wejście Wyczyść

document.getElementById("msg").value = "";
GutoTrosla

Wyczyść pole wejściowe

<h2 id="count-me">4</h2>
<button onclick="save()">Reset</button>

function save() {
  	// If what you want to reset is an integer 
	document.getElementById("count-me").textContent = 0;
  
  	//  If what you want to reset is a textfield
  	document.getElementById("textfield1").value = "";
    let count = 0; // If you create a count variable in Javascript
}
emmanuelAKBI

Odpowiedzi podobne do “Wyczyść pole wejściowe”

Pytania podobne do “Wyczyść pole wejściowe”

Więcej pokrewnych odpowiedzi na “Wyczyść pole wejściowe” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu