0
How can i search a specific keyword in webpage
On selecting a and submitting. In background specified keyword should be searched on specific webpage and display success or failure. Can someone help me out with this
1 Odpowiedź
+ 4
// Use
var html = document.querySelector("html");
var txt = html.innerText;
// to get the text of the whole webpage.
// then use
var search = txt.indexOf(searchStr);
if(search != -1) alert(searchStr + " is found");
// to check keywords in the page.