title: Problem retrieving information from the page and submitting it to the JavaScript object constructor
body: <p>I wanted to create a simple form on the page with a few inputs and button and by receiving information from the inputs. I try to put the person's information on the screen, but the web page does not display the information well, but only shows <code>[object Object]</code>.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function structur() {
    function person(name, family, age) {
      this.name = name;
      this.family = family;
      this.age = age;
    }
    var name1 = document.getElementById('iname').value;
    var family1 = document.getElementById('ifamily').value;
    var age1 = document.getElementById('iage').value;
    var demo = new person(name1, family1, age1)
    document.getElementById('result').innerHTML = demo;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p id="result"&gt;show result here! &lt;/p&gt;
  &lt;button id="show" onclick="structur()"&gt;click to show&lt;/button&gt;
  &lt;input type="text" id="iname" placeholder="name:"&gt;
  &lt;input type="text" id="ifamily" placeholder="family:"&gt;
  &lt;input type="number" id="iage" placeholder="age:"&gt;</code></pre>
  </div>
  </div>
  </p>