How can I empty an input type="number" in javascript. Can you use the document.innerHTML = number; or how is it done?
How can I empty an input type="number" in javascript. Can you use the document.innerHTML = number; or how is it done?
You have to use value
document.getElementById("elIdDelInput").value = "";
greetings
A quick and short way would be this ... assign an ID to your input:
<input type="number" id="input_vaciar" value="12312313"/>
And then you can empty it like this:
$('#input_vaciar').val('');
And if you need to save some specific data after doing an action, it would be like this:
$('#input_vaciar').val(new_val);
(where new_val can be a data that you set so raw or can be a variable that contains a numeric value as a result of X action)