As mentioned in the Question, How can i exclude hidden elements from the document range object. With the below code I can create entire body text range. But I want to exclude hidden elements
document.body.createTextRange()
I am experimenting with the below code
$(':hidden').blur();
document.body.createTextRange()
But it does not work for me.
Please help me on this.
You can’t. Like a DOM Range, a
TextRangerepresents the portion of an HTML document between two boundary points. If you want to represent a portion of the document omitting certain elements, you will need multipleTextRanges.