<head>
<meta charset="UTF-8">
<title>test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
<style>
.is-hidden {
display: none;
}
</style>
<script>
$(function () {
if (localStorage.getItem('transit') !== null) {
var target = localStorage.getItem('transit');
$('#'+target).toggleClass('is-hidden');
localStorage.clear();
}
$('.target-link').on('click', function(e) {
var target = $(this).attr('href').split('#'),
target = target[target.length-1];
if (localStorage.getItem('transit', target) === null) {
localStorage.setItem('transit', target);
}
$('#'+target).toggleClass('is-hidden');
});
});
</script>
<a href="2.html#boxes" class="target-link">Click</a>
<div id="boxes" class="is-hidden">Lorem ipsum</div>
</body>