title: Not able to pass value from [object HTMLInputElement]
body: <p>I am passing hidden value, and getting it into javascript function. I want to pass this value to another page. Before passing when i print it, it gives me [object HTMLInputElement]</p>
  
  <p>$var4 = 1;</p>
  
  <pre><code>echo "&lt;input type='hidden' id='var4' value='$var4'&gt;";
  </code></pre>
  
  <p>and accessing it in javascript</p>
  
  <pre><code>var y = document.getElementById('var4');
     document.write(y);    //[object HTMLInputElement]
  </code></pre>
  
  <p>it gives me output as [object HTMLInputElement] instead of 1</p>
  
  <p>Another thing is that I want to pass this value to data.php </p>
  
  <p>".... data.php?q="+y)</p>
  
  <p>is this write, can i pass value like this?
   Would you suggest me any solution.
  Thanks in advance. </p>