Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve () {
- Array.from(document.querySelectorAll('a')).forEach(a =>
- a.addEventListener('click', function () {
- let count = +this.nextElementSibling.textContent.match(/\d+/)[0] + 1
- this.nextElementSibling.textContent = `Visited: ${count} times`
- })
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement