It depends on the event you are invoking, but basically it will work for most input
.
Javascript
With javascript you can change the value property:
document.getElementById("limpar").addEventListener("click", function() {
clearInputUrlNumberText("entrada");
});
function clearInputUrlNumberText(name) {
var entradas = document.querySelectorAll("input[name='"+name+"']");
[].map.call(entradas, entrada => entrada.value = '');
}
<input name="entrada" type="url">
<input name="entrada" type="number">
<input name="entrada" type="text">
<br>
<button id="limpar">Limpar</button>
jQuery:
With jQuery it's possible using the val method:
$("button").click(function(){
$("input[data-name='entrada']").val('');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><inputdata-name="entrada" type="url">
<input data-name="entrada" type="number">
<input data-name="entrada" type="text">
<br>
<button id="limpar">Limpar</button>