I’m trying to extract the entire text from the HTML document and I was able to see the desired o/p only on
$(document).ready(function(){
console.log($("*").text())
}
and not on the following snippet.
var words = ""
$(document).ready(function(){
words += ($("*").text())
}
console.log(words)
I want text which is getting displayed in the console, to be stored in a variable for computation.
It would be of immense help if anyone could tell me how to do it. Thanks in advance.