Untitled
raw download clone
TEXT
views 25
,
size 471 b
function solve() {
  const links = document.getElementsByClassName('link-1');


  for (let i = 0; i < links.length; i++) {
    links[i].addEventListener('click', event => {
      let currentTarget = event.currentTarget;
      let currentElement = currentTarget.getElementsByTagName('p')[0];
      const visited = currentElement.innerHTML.split(' ');
      visited[1] = Number(visited[1]) + 1;
      currentElement.innerHTML = visited.join(' ');
    });
  }
}
close fullscreen
Login or Register to edit or fork this paste. It's free.