Javascript document.getElementsByName() function is being weird at me
<p>I've got the following variables in my simple javascript calculator:</p>

<pre><code>var distance = parseInt(document.getElementsByName("distance"), 10);
var mins_running = parseInt(document.getElementsByName("mins_running").value, 10);  // the running pace minutes
var secs_running = parseInt(document.getElementsByName("secs_running").value, 10);  //    the running pace seconds
var mins_walking = parseInt(document.getElementsByName("mins_walking").value, 10);  // the walking pace minutes
var secs_walking = parseInt(document.getElementsByName("secs_walking").value, 10);  // the walking pace seconds
</code></pre>

<p>The problem is, when I try to use these variables (entered as text from a form but meant to be used as numbers in the calculator).  When I do a typeof() in the developer console.log I'm told the values are of type 'number', but the <em>very next line</em> is also a console.log('mins_running'), for example, and it explicitly states the value is "NaN".  Is my value a number or not?  What's going on?  Stupid javascript--be more normal, darn it!</p>

<p>Any reasonable input/help will be appreciated.</p>

<p>Thanks for all the help, guys.  Looks like I'm back to using the old Form.elementName.value thing instead.  (if this is a really bad idea or just not good for production code at all, please feel free to say something.)</p>
