Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve() {
- let softUniClicked = document.querySelectorAll(`.link-1`)[0]
- let googleClicked = document.querySelectorAll(`.link-1`)[1];
- let youTudeCicked = document.querySelectorAll(`.link-1`)[2];
- let wikiClicked = document.querySelectorAll(`.link-1`)[3];
- let gmailClicked = document.querySelectorAll(`.link-1`)[4];
- let stackClicked = document.querySelectorAll(`.link-1`)[5];
- let pCreateSoft = document.getElementsByTagName(`p`)[0]
- let pCreateGoog = document.getElementsByTagName(`p`)[1];
- let pCreateYouTude = document.getElementsByTagName(`p`)[2];
- let pCreateWiki = document.getElementsByTagName(`p`)[3];
- let pCreateGmail = document.getElementsByTagName(`p`)[4];
- let pCreateStack = document.getElementsByTagName(`p`)[5];
- softUniClicked.addEventListener(`click`, () => {
- let counter = pCreateSoft.textContent.split(` `)[1]
- counter++;
- pCreateSoft.innerHTML = `visited ${counter} times`
- })
- googleClicked.addEventListener(`click`, () => {
- let counter = pCreateGoog.textContent.split(` `)[1]
- counter++;
- pCreateGoog.innerHTML = `visited ${counter} times`
- })
- youTudeCicked.addEventListener(`click`, () => {
- let counter = pCreateYouTude.textContent.split(` `)[1]
- counter++;
- pCreateYouTude.innerHTML = `visited ${counter} times`
- })
- wikiClicked.addEventListener(`click`, () => {
- let counter = pCreateWiki.textContent.split(` `)[1]
- counter++;
- pCreateWiki.innerHTML = `visited ${counter} times`
- })
- gmailClicked.addEventListener(`click`, () => {
- let counter = pCreateGmail.textContent.split(` `)[1]
- counter++;
- pCreateGmail.innerHTML = `visited ${counter} times`
- })
- stackClicked.addEventListener(`click`, () => {
- let counter = pCreateStack.textContent.split(` `)[1]
- counter++;
- pCreateStack.innerHTML = `visited ${counter} times`
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement