<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="col" data-box-id="1">
<a href="#" >ССЫЛКА1</a>
</div>
<div class="col" data-box-id="2">
<a href="#" >ССЫЛКА 2</a>
</div>
<div class="col" data-box-id="3">
<a href="#" >ССЫЛКА 2</a>
</div>
<div class="col" data-box-id="4">
<a href="#" >ССЫЛКА 2</a>
</div>
<script>
function ready() {
var blockIds = [];
var blocks = document.querySelectorAll('[data-box-id] a');
blocks.forEach(block => block.addEventListener('click', e => {
blockIds.push(e.target.parentNode.getAttribute('data-box-id'));
e.target.parentNode.style.display = 'none';
localStorage.setItem('blocks', JSON.stringify(blockIds));
console.log(localStorage.getItem('blocks'));
}))
}
document.addEventListener("DOMContentLoaded", ready());
</script>
</body>
</html>
var blocks ={
hiddenSince: 'метка времени',
blockIds: blockIds,
}
localStorage.setItem('blocks', JSON.stringify(blocks));