title: create new object on button click
body: <p>I'm new to javascript and this is strictly for practice. I have an html form (below) and I want the submit button to create a new object using the <code>Person</code> constructor when clicked. I want the new object's name to be whatever the user's first name is. For example, if the first name's john it would create a <code>var john = new Person</code>.</p>
  
  <p>Form:</p>
  
  <pre><code>&lt;form name="theform"&gt;
      First name: &lt;input type="text" name="fname"&gt;&lt;br&gt;
      Last name: &lt;input type="text" name="lname"&gt;&lt;br&gt;
      Age: &lt;input type="number" name="age"&gt;&lt;br&gt;
      &lt;input type="button" onClick="new Person()" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Constructor:</p>
  
  <pre><code>function Person(){
      this.firstname = document.theform.fname.value;
      this.lastname = document.theform.lname.value;
      var age = document.theform.age.value;
      this.returnAge = function(){
          return age;
      }
  };
  </code></pre>