title: Getting ID of certain checkboxes and disabling them
body: <p>I'm trying to get the ID of certain checkboxes and set the boxes to disabled based on conditions. However, I get this error on "Add:767 Uncaught TypeError: Cannot read property 'disabled' of null
      at HTMLInputElement.el.addEventListener.event (Add:767)".
  Why is it returning null? Am I not getting the element by ID?</p>
  
  <p>This is the JS:</p>
  
  <pre><code>    var days = 0;
      const checkboxMonthElement = document.querySelectorAll('.checkboxMonth');
      const checkboxDofmElement = document.querySelectorAll('.checkboxDofM');
  
  
      var test123 = document.getElementById('#Schedule_DofMInfo_27__IsChecked');
  
      checkboxMonthElement.forEach(el =&gt; el.addEventListener('change', event =&gt; {
  
          days = 0;
  
          for (var i = 0; i &lt; checkboxMonthElement.length; i++) {
  
  
              var NofD = parseInt($(checkboxMonthElement[i]).attr('data-test'));
  
              if (checkboxMonthElement[i].checked) {
                  if (days &lt; NofD)
                      days = NofD;
              }
          }
          console.log(days);
  
          if (days = 28) {
              console.log("Days is 28");
              console.log(test123);
  
             document.getElementById('#Schedule_DofMInfo_27__IsChecked').disabled === true;
          }
  
  
  
  
  
      }));
  </code></pre>
  
  <p>Here is the HTML:</p>
  
  <pre><code>   &lt;li class="list-group-item" style="display:inline-block"&gt;
                      &lt;div class="checkbox-inline" id="checkboxDofM"&gt;
                          &lt;input data-val="true" data-val-number="The field DofMID must be a number." data-val-required="The DofMID field is required." id="Schedule_DofMInfo_26__DofMID" name="Schedule.DofMInfo[26].DofMID" type="hidden" value="26" /&gt;
                          &lt;input class="checkboxDofM" data-val="true" data-val-required="The IsChecked field is required." id="Schedule_DofMInfo_26__IsChecked" name="Schedule.DofMInfo[26].IsChecked" type="checkbox" value="true" /&gt;&lt;input name="Schedule.DofMInfo[26].IsChecked" type="hidden" value="false" /&gt;
                          &lt;label for="Schedule_DofMInfo_26__IsChecked"&gt;27&lt;/label&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
                  &lt;li class="list-group-item" style="display:inline-block"&gt;
                      &lt;div class="checkbox-inline" id="checkboxDofM"&gt;
                          &lt;input data-val="true" data-val-number="The field DofMID must be a number." data-val-required="The DofMID field is required." id="Schedule_DofMInfo_27__DofMID" name="Schedule.DofMInfo[27].DofMID" type="hidden" value="27" /&gt;
                          &lt;input class="checkboxDofM" data-val="true" data-val-required="The IsChecked field is required." **id="Schedule_DofMInfo_27__IsChecked"** name="Schedule.DofMInfo[27].IsChecked" type="checkbox" value="true" /&gt;&lt;input name="Schedule.DofMInfo[27].IsChecked" type="hidden" value="false" /&gt;
                          &lt;label for="Schedule_DofMInfo_27__IsChecked"&gt;28&lt;/label&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
                  &lt;li class="list-group-item" style="display:inline-block"&gt;
                      &lt;div class="checkbox-inline" id="checkboxDofM"&gt;
                          &lt;input data-val="true" data-val-number="The field DofMID must be a number." data-val-required="The DofMID field is required." id="Schedule_DofMInfo_28__DofMID" name="Schedule.DofMInfo[28].DofMID" type="hidden" value="28" /&gt;
                          &lt;input class="checkboxDofM" data-val="true" data-val-required="The IsChecked field is required." id="Schedule_DofMInfo_28__IsChecked" name="Schedule.DofMInfo[28].IsChecked" type="checkbox" value="true" /&gt;&lt;input name="Schedule.DofMInfo[28].IsChecked" type="hidden" value="false" /&gt;
                          &lt;label for="Schedule_DofMInfo_28__IsChecked"&gt;29&lt;/label&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
                  &lt;li class="list-group-item" style="display:inline-block"&gt;
                      &lt;div class="checkbox-inline" id="checkboxDofM"&gt;
                          &lt;input data-val="true" data-val-number="The field DofMID must be a number." data-val-required="The DofMID field is required." id="Schedule_DofMInfo_29__DofMID" name="Schedule.DofMInfo[29].DofMID" type="hidden" value="29" /&gt;
                          &lt;input class="checkboxDofM" data-val="true" data-val-required="The IsChecked field is required." id="Schedule_DofMInfo_29__IsChecked" name="Schedule.DofMInfo[29].IsChecked" type="checkbox" value="true" /&gt;&lt;input name="Schedule.DofMInfo[29].IsChecked" type="hidden" value="false" /&gt;
                          &lt;label for="Schedule_DofMInfo_29__IsChecked"&gt;30&lt;/label&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
                  &lt;li class="list-group-item" style="display:inline-block"&gt;
                      &lt;div class="checkbox-inline" id="checkboxDofM"&gt;
                          &lt;input data-val="true" data-val-number="The field DofMID must be a number." data-val-required="The DofMID field is required." id="Schedule_DofMInfo_30__DofMID" name="Schedule.DofMInfo[30].DofMID" type="hidden" value="30" /&gt;
                          &lt;input class="checkboxDofM" data-val="true" data-val-required="The IsChecked field is required." id="Schedule_DofMInfo_30__IsChecked" name="Schedule.DofMInfo[30].IsChecked" type="checkbox" value="true" /&gt;&lt;input name="Schedule.DofMInfo[30].IsChecked" type="hidden" value="false" /&gt;
                          &lt;label for="Schedule_DofMInfo_30__IsChecked"&gt;31&lt;/label&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
          &lt;/ul&gt;
          &lt;div class="checkbox-inline"&gt;
              &lt;input id="checkAllDofm" name="checkAll" onclick="toggleDofM(this);" type="checkbox" value="true" /&gt;&lt;input name="checkAll" type="hidden" value="false" /&gt;
              &lt;label for="Select_All"&gt;Select All&lt;/label&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/center&gt;
  </code></pre>