I have two files test.html and test2.html I am able to save the value of the forms but cannot fill the input field in test2.html form.
Test.html
<script type="text/javascript">
function store(){
var inputEmail= document.getElementById("email");
localStorage.setItem("email", inputEmail.value);
}
</script>
<form action="test2.html" class="form-login" method="post" />
<input name="email" type="email" id="email" required="" placeholder="Email" />
<button onclick="store()" type="button">StoreEmail</button>
Test2.html
<script type="text/javascript">
function get(){
var storedValue = localStorage.getItem("email");
document.getElementById("email").innerHTML = storedValue;
document.getElementById("email").value = storedValue;
}
</script>
<p id="email">qqqqqq</p>
<form action="" class="form-login" method="post" />
<input name="email" type="email" id="email" placeholder="Email" />
<button onclick="get()" type="button">getEmail</button>
When I click on getEmail button the paragraph changes but the Email input field doesn't change with the value. Please help.