javascript check if a string exists in document code example
Example: if text exists in element using javascript
if (
(
document.documentElement.textContent || document.documentElement.innerText
).indexOf('Done successfuly') > -1
) {
// Do something...
}