<div class="tv"><div class="date">1</div><div class="spoiler clear">Текст 1</div></div>
<div class="tv"><div class="date">2</div><div class="spoiler clear">Текст 2</div></div>
<div class="tv"><div class="date">3</div><div class="spoiler clear">Текст 3</div></div>
<script>
(function(){
var active = null;
var onclick = function() {
var block = this.parentNode.querySelector('.spoiler');
if (active !== null) {
active.className += ' clear';
if (active === block) {
active = null;
return;
}
active = null;
}
block.className = 'spoiler';
active = block;
}
var togglers = document.querySelectorAll('.tv .date');
for (var i = 0, toggler; toggler = togglers[i]; i++) {
toggler.onclick = onclick;
}
})();
</script>