<!DOCTYPE html>
<html>
<body>

<form id="myForm">
  <input type="week" id="myWeek">
</form>

<p>Click the button to return the id of the form the week field belongs to.</p>

<button onclick="myFunction()">Try it</button>

<p><strong>Note:</strong> input elements with type="week" are not supported in Internet Explorer or Firefox.</p>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myWeek").form.id;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>