Skip to content
Related Articles

Related Articles

HTML DOM Input week list Property

View Discussion
Improve Article
Save Article
  • Last Updated : 01 Aug, 2022

The input week list property in HTML DOM is used to return the reference to the list element that contains an input week 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 week list property.  


<!DOCTYPE html>
    <title> HTML DOM Input Week list Property</title>
<body style="text-align:center;">
    <h1 style="color:green;">
    <h2>DOM Input Week list property</h2>
    <form id="formID">
        <input type="week" id="week_id"
            list="week_list" name="geeks"
        <datalist id="week_list">
            <option value="2021-W12" />
            <option value="2022-w23" />
            <option value="1999-W14" />
            <option value="2022-w15" />
            <option value="1998-W19" />
    <button onclick="btnclick()">
        Click Here!
    <p id="paraID" style="font-size:20px;"></p>
    <!-- Script returns the Input week list property  -->
        function btnclick() {
            var weeklistVar = document
                .innerHTML = weeklistVar;



Supported Browsers:

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!