I have one simple JSP having four buttons ( Button1 , Button2 , Button3 and Button4).
The button value set into hidden field when I click on button.
I need to get the latest button click value after refresh the page ( preserve the button value).
could anyone please help me ?
<script>
function one(tab){
document.getElementById('h').value=tab;
}
function fun(){
var value =document.getElementById('h').value;
alert(value);
}
</script>
<td> <input type="button" name="Tab1" id="Tab1" value="Table One" onClick="one('1')"/></td>
<td> <input type="button" name="Tab2" id="Tab2" value="Table Two" onClick="one('2')"/></td>
<td> <input type="button" name="Tab3" id="Tab3" value="Table Three"onClick="one('3')"/></td>
<td> <input type="button" name="Tab4" id="Tab4" value="Table four" onClick="fun()"/></td>
<input type="hidden" name="h" id="h" value=""/>