title: How to add a class to multiple elements?
body: <p>Basically I like to add a new class to multiple elements with the same class name. Currently it adds a class only to the last one. I have tried using document.querySelectorAll but got no results. What I'm missing?</p>
  
  <p><strong>HTML example</strong></p>
  
  <pre><code>&lt;div class="model"&gt;&lt;/div&gt;
  &lt;div class="model"&gt;&lt;/div&gt;
  &lt;div class="model"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code> _updateParagraph: function(settings, className) {
      var paragraph = document.querySelector('.' + className);
      paragraph.className = className;
      this._updateParagraphClasslist(settings, paragraph);
    },
  </code></pre>
  
  <p><strong>FULL JS</strong></p>
  
  <pre><code>App.Views.Preview = Backbone.View.extend({
    el: "#preview",
    initialize: function() {
      this.listenTo(this.model, "change", this.update);
    },
    update: function() {
      var
  
        layout = [this.model.get("model")],
        format   = [this.model.get("size"), this.model.get("color-outside"), this.model.get("color")],
        color    = [this.model.get("color-inside")],
        material = [this.model.get('material')],
        lamination = [this.model.get('lamination')],
        logo = [this.model.get('embossing')];
  
      this._updateParagraph(layout, 'layout');
      this._updateParagraph(format, 'front');
      this._updateParagraph(format, 'back');
      this._updateParagraph(lamination, 'kit-front');
      this._updateParagraph(lamination, 'kit-back');
      this._updateParagraph(logo, 'embossing');
      this._updateParagraph(color, 'colorinner');
      this._updateParagraph(color, 'model');
  
  
    },
    _updateParagraph: function(settings, className) {
      var paragraph = document.querySelector('.' + className);
      paragraph.className = className;
      this._updateParagraphClasslist(settings, paragraph);
    },
    _updateParagraphClasslist: function(settings, paragraph) {
      _.each(settings, function(setting) {
        if (_.has(setting, "visual")) {
          paragraph.classList.add(setting.visual);
        }
      });
    }
  });
  </code></pre>