if ( ( document.documentElement.textContent || document.documentElement.innerText ).indexOf('Done successfuly') > -1 ) { // Do something... }