title: input text box get NaN value
body: <p>I want write a sum of values in a textbox. For that I have this two parts of code:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;label for="test1"&gt;Value(€)&lt;/label&gt;
  &lt;input type="text" name="test1" id="test1" value="0"&gt;&lt;br&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>function selected_feature(event){
      //set to 0
      document.getElementById('test1').value = 0;
  
      //Loop
      for(var i=0; i&lt;elements.selectedFeatures.length; i++)   {
          var elements;
          elements += parseFloat(elements.selectedFeatures[i].attributes.value_elements);
          document.getElementById('test1').value = elements;
      }
  
  }
  </code></pre>
  
  <p><a href="http://pastebin.com/N2jnaQ4x" rel="nofollow">http://pastebin.com/N2jnaQ4x</a></p>
  
  <p>Conclusion: I get the value 'NaN' in textbox. I have tried many things with 'parsefloat' but nothing works. If i make an 'alert (typeof elements')' in the end of function i get 'number'.
  Why textbox received 'NaN'?Can anyone help me ?</p>
  
  <p>Thanks</p>