<html>
<body>
<input type="week" id="myWeek">
<p>Click the button to set the week field to read-only.</p>
<p><strong>Tip:</strong> To see the effect, try to type something in the week field before and after clicking the button.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("myWeek").readOnly = true;
}
</script>
</body>
</html>