Skip to content
Related Articles

Related Articles

HTML DOM Input Datetime list Property

Improve Article
Save Article
  • Last Updated : 14 May, 2022
Improve Article
Save Article

The input DateTime list property in HTML DOM is used to return a reference to the list element that contains an input DateTime field.


Return value: It returns a string value that represents the value of the id attribute of the datalist element.

Example:  Below HTML code is used to return the input datetime list property.  


<!DOCTYPE html>
    <title>Input Datetime list Property in HTML</title>
        h1 {
            color: green;
        body {
            text-align: center;
    <h2>Input Datetime list property</h2>
    <br> Date Of Birth:
    <input type="datetime" id="Test_Datetime" 
        value="2019-11-11" list="DateTime_list">
    <datalist id="DateTime_list">
        <option value="2019-11-11" />
        <option value="2019-12-01" />
        <option value="2019-04-11" />
        <option value="2005-09-12" />
        <option value="2022-03-12" />
    <button ondblclick="My_Datetime()">
        Return Date And Time
    <p id="test" style="font-size:20px"></p>
        function My_Datetime() {
            var datetimeVar = document
                .innerHTML = datetimeVar;



Supported Browsers:

  • Google Chrome
  • Edge
  • Mozilla Firefox
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!