Created
April 1, 2022 11:53
-
-
Save elishaukpong/1217561b05b1666dacd3d21851be4371 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const targetNode = document.querySelector('.cff-wrapper-ctn'); | |
const config = { childList: true, subtree: true }; | |
function addBorder(){ | |
const posts = Array.from(document.getElementsByClassName('cff-item')); | |
posts.forEach(post =>{ | |
let count = parseInt(post.getElementsByClassName('cff-count')[0].innerHTML); | |
if(count >= 3){ | |
post.style.border = '1px solid black'; | |
} | |
}); | |
} | |
const observer = new MutationObserver(function(mutationList, observer){ | |
addBorder(); | |
}); | |
observer.observe(targetNode, config); | |
addBorder(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment