The Input Date select() Method in HTML DOM is used to select the contents of the Date text field. It is the predefined method of the Input date object.
Syntax:
dateObject.select()
Parameter: This method does not contain any parameters.
Return Values: It does not return any value.
Example: Below example illustrates the use of the Input Date select() Method in HTML DOM.
<!DOCTYPE html>
<html>
<head>
<title>HTML DOM Input Date select() Method</title>
<style>
h1 {
color: green;
}
h2 {
font-family: Impact;
}
body {
text-align: center;
}
</style>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>Input Date select() Method</h2>
<br>
<input type="date" id="test_Date" autofocus>
<p>
To select the content of the Date Field,
double click the "Check me!" button.
</p>
<button ondblclick="My_selectDate()">
Check me!
</button>
<script>
function My_selectDate() {
var d = document.getElementById(
"test_Date").select();
}
</script>
</body>
</html>
Output:

Supported Browsers:
- Google Chrome 20
- Edge 12
- Opera 11
- Firefox 57
- Safari 14.1