Don't know how to put the question title correctly! I have a div that is displayed by button click. The problem is that if user goes to next page(by clicking another button) and then come back to the old page the div is not shown because page is refreshed, so user needs to click the button again to see the div.
Is there any way to keep div displayed after button clicked for first time?
<div id="tableDiv" style="display:none;" >
<table>
<td>something</td>
</table>
</div>
<input type="button" value="Show" onClick="showTable()"/>
<script type="text/javascript">
function showTable() {
document.getElementById('tableDiv').style.display = "block";
}
</script>
See Question&Answers more detail:os