title: Change CSS property only in getElementsByName
body: <p>Looking for a way to change the CSS property by certain names.</p>
  <p>Down below I have an example using checkboxes. There are two types that are generally the same unless changeSpecialCheckBox() occurs with a true value within its parameter.</p>
  <p>file.css</p>
  <pre class="lang-css prettyprint-override"><code>.checkBoxApperance {
      width: 100px;
      height: 50px;
      background: 'dark-blue';
  }
  </code></pre>
  <p>file.html</p>
  <pre class="lang-html prettyprint-override"><code>&lt;!--regularCheckBox--&gt;
  &lt;div class=&quot;checkBoxApperance&quot;&gt;
     &lt;input type=&quot;checkbox&quot; id=&quot;regularCheckBox1&quot; name=&quot;regularCheckBox&quot;/&gt;
  &lt;/div&gt;
  &lt;div class=&quot;checkBoxApperance&quot;&gt;
     &lt;input type=&quot;checkbox&quot; id=&quot;regularCheckBox2&quot; name=&quot;regularCheckBox&quot;/&gt;
  &lt;/div&gt;
  &lt;div class=&quot;checkBoxApperance&quot;&gt;
     &lt;input type=&quot;checkbox&quot; id=&quot;regularCheckBox3&quot; name=&quot;regularCheckBox&quot;/&gt;
  &lt;/div&gt;
  
  &lt;!--specialCheckBox--&gt;
  &lt;div class=&quot;checkBoxApperance&quot;&gt;
     &lt;input type=&quot;checkbox&quot; id=&quot;specialCheckBox1&quot; name=&quot;specialCheckBox&quot;/&gt;
  &lt;/div&gt;
  &lt;div class=&quot;checkBoxApperance&quot;&gt;
     &lt;input type=&quot;checkbox&quot; id=&quot;specialCheckBox2&quot; name=&quot;specialCheckBox&quot;/&gt;
  &lt;/div&gt;
  &lt;div class=&quot;checkBoxApperance&quot;&gt;
     &lt;input type=&quot;checkbox&quot; id=&quot;specialCheckBox3&quot; name=&quot;specialCheckBox&quot;/&gt;
  &lt;/div&gt;
  
  </code></pre>
  <p>file.js</p>
  <pre class="lang-js prettyprint-override"><code>function changeSpecialCheckBox(condition)
  {
    if(condition) {
      document.getElementsByName(&quot;specialCheckBox&quot;).forEach(elem =&gt; {
        elem.disabled = true;
        $('.checkBoxApperance').css(&quot;background-color&quot; , &quot;light-blue&quot;); //change the appearance
                                                                       //of all checkboxes
                                                                       //instead of all checkboxes under
                                                                       //the &quot;specialCheckBox&quot; name
        });
    }
  }
  
  </code></pre>