1 <!DOCTYPE html>
2 <html>
3 <style>
4 .container {
5 margin: 20px 0;
6 }
7 </style>
8 <body>
9 <h1>The Input Week Object</h1>
10 <h2>Example</h2>
11
12 <div class="container">
13 <form>
14 <input type="week" id="week" />
15 </form>
16 </div>
17 <button onclick="access()">Access</button>
18
19 <p id="result"></p>
20 <script>
21 function access() {
22 const element = document.getElementById("week");
23 const str = `The form has <b>${element.form.length}</b> elements`;
24 document.getElementById("result").innerHTML = str;
25 }
26 </script>
27 </body>
28 </html>