Episode
5
February 2, 2024
![](https://assets-global.website-files.com/636c3b6dcdb4eb2dce722889/65ba31e5367738c736c96338_SQUIP_S03E05_5.png)
var currentEpisode = document.querySelector('.post-id').textContent;
var next = +currentEpisode + 1;
var prev = +currentEpisode - 1;
var nextLink, prevLink;
document.querySelectorAll('.post-list-number').forEach(el => {
var link = el.parentNode;
var num = el.textContent;
if (num == prev)
prevLink = link.href;
if (num == next)
nextLink = link.href;
});
var nextEl = document.querySelector('.next-link');
var prevEl = document.querySelector('.prev-link');
if (nextLink) {
nextEl.href = nextLink;
} else {
nextEl.class = 'display-none';
}
if (prevLink) {
prevEl.href = prevLink;
} else {
prevEl.class = 'display-none';
}