Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
Birthday: <input type="date" id="myDate" name="bday">
<p>Click the button to display the value of the name attribute of the date field.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  let x = document.getElementById("myDate").name;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>