title: how to enable/disable buttons in HTML jscript
body: <p>I am trying to enable buttons on a web page using a js funtion for a django project.
  I am new this so please be cool :-)</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function change(id) {
    var elem = document.getElementById(id);
    let editID = "edit_".concat(id);
    let deleteID = "delete_".concat(id);
  
    if (elem.value == "Undo") {
      elem.value = "Modify";
      editButtonElement = document.getElementsByName(editID);
      editButtonElement.disabled = false;
  
      deleteButtonElement = document.getElementsByName(deleteID);
      deleteButtonElement.disabled = false;
    } else {
      elem.value = "Undo";
      editButtonElement = document.getElementsByName(editID);
      editButtonElement.disabled = true;
  
      deleteButtonElement = document.getElementsByName(deleteID);
      deleteButtonElement.disabled = true;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input onclick="change(id)" type="button" value="Modify" id="11" class="btn btn-info"&gt;&lt;/input&gt;
  
  &lt;div class="btn-group" role="group" aria-label="Basic example"&gt;
    &lt;button type="button" class="btn btn-secondary" disabled="false" id="edit_11"&gt;Edit&lt;/button&gt;
    &lt;button type="button" class="btn btn-secondary" disabled="false" id="delete_11"&gt;Delete&lt;/button&gt;
  &lt;/div&gt;
  
  &lt;br&gt;
  
  &lt;input onclick="change(id)" type="button" value="Modify" id="22" class="btn btn-info"&gt;&lt;/input&gt;
  
  &lt;div class="btn-group" role="group" aria-label="Basic example"&gt;
    &lt;button type="button" class="btn btn-secondary" disabled="false" id="edit_22"&gt;Edit&lt;/button&gt;
    &lt;button type="button" class="btn btn-secondary" disabled="false" id="delete_22"&gt;Delete&lt;/button&gt;
  &lt;/div&gt;
  
  &lt;br&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>What I would like to happen is for the name of the main button change from <code>&quot;Modify&quot;</code> to <code>&quot;Undo&quot;</code>, which happens. But I'd also like for the two related <code>Edit</code> and <code>Delete</code> buttons to be enabled so as to press them.</p>
  <p>Anyone can tell me what I am doing wrong?
  Thanks!</p>