title: i want to store text under p tag in javascript variable then show in input field
body: <p>i want store text in p tag in javascript varible and then text show in input field.</p>
  
  <pre><code>&lt;p id="txt" onclick="check();"&gt;yes i am stroe in js variable&lt;/p&gt;
  &lt;input id="show" type="text" name="" disabled=""&gt;
  
      &lt;script type="text/javascript"&gt;
  function check() {
      var input = document.getElementById("txt").text;
  
      document.getElementById("show")=input.value;
  }
  &lt;/script&gt;
  </code></pre>