Solo tenemos que identificar el elemento y en
value
asignar
''
(un string vacio)
<!DOCTYPE html>
<html>
<body>
<p>Clear the input field when it gets focus:</p>
<input type="text" id="input1">
<button type="button" onclick="miFuncion()">Click</button>
</body>
<script>
function miFuncion(){
x = document.getElementById('input1');
x.value='';
}
</script>
</html>
- https://stackoverflow.com/questions/17237772/html-how-to-clear-input-using-javascript
- https://www.w3schools.com/howto/howto_html_clear_input.asp
No hay comentarios.:
Publicar un comentario