I want to be able to enable the checkbox 'present' to disable the input 'dateend'. Here's what I've tried to do, where am I going wrong?
<input type="month" name="dateend" class="form-control" required>
<input type="checkbox" id="present" onchange="present()">
<script>
function present() {
document.getElementsByName("dateend").disabled = true;
}
</script>