3
I have the following encoding and would like to clear the form of all fields that have the same name
. But I don’t know why you don’t clear the fields
PS: What properties of input text
I can use for this kind of thing?
function limpaCampos() {
document.getElementsByName("form_txt").value = ''; // Limpa o campo
console.log(document.getElementsByName("form_txt").value);
}
<html>
<body>
<input id="01" type="text" name="form_txt"/>
<input id="01" type="text" name="form_txt"/>
<input type="button" onclick="limpaCampos();"/>
</body>
</html>
Got it, thanks a lot @guastallaigor!!!
– Sora