title: my value property doesn't pass me anything
body: <p>I'm trying to simply get the value of an input and put it into a p tag.but it looks like that I'm not getting anything from the input tag</p>
  <pre><code>&lt;body&gt;
      &lt;input type=&quot;text&quot; id=&quot;text&quot;&gt;
      &lt;button class=&quot;button&quot; onclick=&quot;sum();&quot;&gt;click&lt;/button&gt;
      &lt;p id=&quot;lblResult&quot;&gt;Result&lt;/p&gt;
  &lt;/body&gt;
  
  &lt;script&gt;
      const text = document.getElementById('text').value;
      function sum()
      {
         document.getElementById('lblREsult').innerHTML = text;
      }
  
   &lt;/script&gt;
  </code></pre>