Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h2>Use select() to select the content of a Date Field</h2>
Date: <input type="date" id="myDate" value="2014-02-09">
<p>Click the button to select the content of the date field.</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
  document.getElementById("myDate").select();
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_date_select by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 15:53:05 GMT -->
</html>