SHARE
TWEET

Untitled

a guest May 25th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve() {
  2.     const links = document.querySelectorAll('a');
  3.     [...links].forEach(link => link.addEventListener('click', function(evt) {
  4.       const p = evt.currentTarget.nextElementSibling;
  5.       const visitedCount = +(p.textContent).match(/\d+/)[0] + 1;
  6.       p.textContent = `Visited: ${visitedCount} times`;
  7.     }));
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top