I need to check if a page contains some text. Here is the code that doesn't work, but i am not able to determine why:
var st1 = "Not";
var st2 = "available";
var tosearch = str1.concat(str2);
document.write(tosearch);
var Availability = "not defined";
if(document.body.innerHTML.toString().indexOf(tosearch) > -1){
Availability = "yes";
} else {
Availability = "fdssssssssssssssssssssssss";
}
st1andst2but you are usingstr1andstr2... was that a typo?