title: Changing the 'disabled' attribute with javascript
body: <p>I have a problem with a button attribute. It does not matter whether YES or NO is changed. I suspect the problem here is <code>button.disabled</code> because it does not highlight the word "disabled". </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>window.onload = function() 
  {
      var button = document.getElementsByName("button");
      var regulamin = document.getElementsByName("accept");
   
    //console.log(button);
  
     for (var i = 0; i &lt; regulamin.length; i++)
     {
         regulamin[i].onclick = function()
         { 
          //alert(this.value === "true");  &lt;-- here is OK
             button.disabled = (this.value === "true");  &lt;-- not OK
         };
     }
  
  };</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form&gt;
      &lt;div&gt;
          &lt;label&gt;&lt;input type="radio" name="accept" value="true" checked&gt;NO&lt;/label&gt;
          &lt;label&gt;&lt;input type="radio" name="accept" value="false"&gt;YES&lt;/label&gt;
      &lt;/div&gt;
      &lt;button type="submit" name="button" disabled&gt;REGISTER&lt;/button&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>