I encountered a problem in Firefox that it doesn't support InnerText when I try to extract only text from an HTML.
It works fine in chrome. So tried to remove the HTML tags from the InnerHTML string. Below is the solution for that.
- document.getElementById("mainDiv").InnerText
- var html = document.getElementById("mainDiv");
- var text = html.replace(/<\S[^><]*>/g, '');
No comments:
Post a Comment