Faizan Amjad

Faizan Amjad

  • 780
  • 967
  • 105.7k

passing data to another HTML page

Sep 3 2014 9:27 AM

I have two HTML pages: form.html and display.html. In form.html, there is a form:

<form action="display.html" method=Get  >
 <input type="text" name="serialNumber" /> 
<input type="submit" value="Submit" />
 </form>

The form data is sent to display.html. I want to display and use the form data serialNumber in display.html, something like the following:

<body> 
<div id="write"><p>The serial number is: </p></div> 
<script> function show() 
{ 
document.getElementById("write").innerHTML = serialNumber;
 } 
</script> 
</body>

Answers (2)