Edit This Code:
<!DOCTYPE html>
<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><strong>Note:</strong> input elements with type="week" are not supported in Internet Explorer or Firefox.</p>

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

<script>
function myFunction() {
    document.getElementById("myWeek").readOnly = true;
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy