JSFiddle - React, Tailwind, and code Playground
by p4bl1t0
HTML
<label for="calendario">Seleccione una fecha :</label>
<input type="date" id="calendario" />
<input type="button" id="mostrar" value="Mostrar Valor" />
<input type="button" id="limpiar" value="Limpiar Valor" />
JavaScript
$('#mostrar').click(function(){
alert(document.getElementById('calendario').value);
});
$('#limpiar').click(function(){
document.getElementById('calendario').value = '';
});
$("#calendario").keypress(function(event) {
if ( event.which == 0 ) {
document.getElementById('calendario').value = '';
}
});