If you want something to be constant in the browser navigation, you can save the information in a hidden INPUT field:
<input type="hidden" id="persistentValue" />
Then use some jQuery code to test it and take action:
$(document).ready(function() {
var persistentValue = $("#persistentValue").val();
if (persistentValue && persistentValue != "") {
}
});
And to keep the text selected (once you have defined it), use:
$("#persistentValue").val("your value here");
Thus, if you go from your page and go back, the INPUT values will be restored and your text will be highlighted again.
source
share