Comment puis-je Code lien: strong> Projet Lien P>
4 Réponses :
Vous devez simplement écrire "nom_of_object" .SetText (""); code> p>
Jetez un coup d'oeil à ceci:
p>
<!DOCTYPE html>
<html>
<body>
<p>Enter some text in the fields below,
then press the "Reset form" button to
reset the form.</p>
<form id="myForm">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br><br>
<input type="button" onclick="submit()" value="Reset form">
</form>
<script>
function submit() {
/*Put all the data posting code here*/
document.getElementById("myForm").reset();
}
</script>
</body>
</html>document.getElementById("city").value = ""
--- This will work if it is an input field, or text area.
getWeather = async (e) => {
e.preventDefault();
// const city = e.target.elements.city.value;
const element = e.target.elements.city;
const city = element.value;
// after data fetching or at once
element.value="";
Also read docs about uncontrolled components.
Merci c'est du travail pour Vide City Field mais est toujours le Time B> n'est pas exactement (dans Détails B>)
S'il vous plaît fournir ce que vous avez essayé jusqu'à présent.