I have a openpopup() to open a popup contains two button yes and no. if visitor click yes then the pop up should be disabled throughout its session.So idea is to set a session variable on click of 'yes' button and get in openpopup() to check if visitor clicked 'yes'. onclick 'yes'
<input type='button' onclick='abc'>
<script>
function abc() {
$("#divid").hide();
if (!localStorage['visited']) {
openpopup();
localStorage['visited'] = "yes";
}
}
</script>
Issue : I need to set expiration of local storage. plz help