I have already created a HTML file for these using edit box
<form name="form1" action="form1.html"  method="get">    
  <img src="index.jpeg" alt="Register" width="100" height="100" align="middle"><br>
  <b>First name: </b><input type="text" name="firstname" id="fname"><br>    
  <b>Last name: </b><input type="text" name="lastname"><br>    
  <b>Password: </b> <input type="password" name="pwd"><br><br>
I cannot pass this values to this variables and ID and display it in another HTML file
function func () {    
  var firstname = document.form1.fname.value;     
  document.getElementById("demo").innerHTML=firstname;   
  var lastname=document.form1.lname.value;    
  document.getElementById("demo").innerHTML=lastname;    
}
Please help me in this
 
     
     
    