title: How to set multiple attributes in model (Backbone.js) using strings as keys?
body: <p>I have a similar question like this: <a href="https://stackoverflow.com/questions/8498915/setting-backbone-models">setting backbone models</a> but I need to set multiple attributes, not only one.</p>
  
  <p>So, I have a model in which someone can add custom attributes and I have problem setting them, because if I do it this way: </p>
  
  <pre><code>parameter.set({
      name: nameValue, 
      value: valueValue,
      description: descriptionValue
  });
  </code></pre>
  
  <p>where <code>name, value</code> and <code>description</code> are string values, backbone is creating a new attribute by the name of "name", "value" and "description", but I actually need them to be values of the "name" etc.</p>
  
  <p>If I try to do it this way:</p>
  
  <pre><code>parameter.set(name, nameValue);
  parameter.set(value, valueValue);
  parameter.set(description, descriptionValue);
  </code></pre>
  
  <p>backbone creates only the last line: <code>parameter.set(description, descriptionValue);</code></p>
  
  <p>the same thing happens when I try to do it this way:</p>
  
  <pre><code>parameter.attributes[name] = nameValue;
  parameter.attributes[value] = valueValue;
  parameter.attributes[description] = descriptionValue;               
  </code></pre>
  
  <p>so, for example, let's say I have this HTML code:</p>
  
  <pre><code>&lt;input type="text" id="name"/&gt;
  &lt;input type="text" id="nameValue"/&gt;
  
  &lt;input type="text" id="value"/&gt;
  &lt;input type="text" id="valueValue"/&gt;
  
  &lt;input type="text" id="description"/&gt;
  &lt;input type="text" id="descriptionValue"/&gt;
  </code></pre>
  
  <p>where:</p>
  
  <pre><code>var name = this.$('#name');
  var nameValue = this.$('#nameValue');
  var value = this.$('#value');
  var valueValue = this.$('#valueValue');
  var description = this.$('#description');
  var descriptionValue = this.$('#descriptionValue');
  </code></pre>