Last active
March 25, 2020 12:56
-
-
Save jdvivar/bd41756f78942a791ed68b2eeefd83ed to your computer and use it in GitHub Desktop.
Wait for an element to appear, then when it does, do something with it
This file contains hidden or 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 interval = window.setInterval(() => { | |
// Search target element | |
const target = document.querySelector(...) | |
if (target) { | |
window.clearInterval(interval) | |
// Do something with target element | |
target.innerText = 'Meow' | |
} | |
}, 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment