Last active
May 1, 2022 19:31
-
-
Save ReenaVerma/04526929d036d414498f8fd270ae585a to your computer and use it in GitHub Desktop.
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 waitForElement = (className, callBack) => { | |
window.setTimeout(function(){ | |
const element = document.querySelector(className); | |
if(element) { | |
callBack(className, element); | |
console.log("Element exists..."); | |
} else { | |
waitForElement(className, callBack); | |
console.log("Wait for element..."); | |
}; | |
}, 1000); | |
}; | |
waitForElement(".fare-card-outer-wrapper",function(){ | |
console.log("Write logic here..."); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment