I have a search form where onclick of the submit button it displays the form value underneath. This is the code:
<input type="text" name="searchfield" id="searchfield" value="" />
<input type="submit" name="submit" id="submitSearch" value="Submit" onclick="document.getElementById('output').innerHTML = document.getElementById('searchfield').value" />
<div id="output"></div>
It works fine, but once submitted (the page reloads rather than going to another page) the value in the output div disappears.
Is there a way to make the value remain, even after page reload?
I'm trying to find the simplest way to achieve this.
</div>