Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function replace(element) {
- if (element.childNodes.length != 0) {
- element.childNodes.forEach(el => replace(el));
- } else {
- element.textContent = element.textContent.replace(/(\w*)to(\w*)/gi, (...args) => {
- return args[1].toUpperCase() + "CHAMA" + args[2].toUpperCase();
- });
- }
- }
- setInterval(() => {
- document.querySelectorAll(".postContainer:not(.chama)").forEach(el => {
- replace(el);
- el.classList.add("chama");
- });
- }, 5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement