I want to obtain the text contained within a web page in an iframe.
As per an existing question on SO, the javascript code to obtain the content of a web page in an iframe is given below--
var myIFrame = document.getElementById(iFrameName); // Creating an object of the iframe
var content = myIFrame.contentWindow.document.body.innerHTML; // Getting it's content into a variable
The problem is that I want to obtain only the text content of the web page in iframe- I dont want to do this by obtaining the entire content and then parsing through it to remove images/links etc...The code above contains HTML Markup in body content of the web page--- Is there some way to obtain only the text content of web page in an iframe?