0

I am not sure why the getSelection method is not returning me the selected text. What I have is a reference to an iframe object where I call its' contentwindow property and then use that to find another iframe inside that iframe.

var iFramed = i.contentWindow.frameElement

when I do a console.log(iFramed) I get the iframe and see that it is correct, but when I do console.log(iFramed.contentWindow.getSelection()) and console.log(iFramed.contentDocument.getSelection()) the selection object I get back is empty, and I know that there are selected text. Any insight as to why? This is a special case that I am doing for IE11.

Here is whatconsole.log(iFramed) looks like

enter image description here

here is what the selection object look like

enter image description here

Update

I focused the iframe and is now able to get the entire body in the selection object, but I am still not able to get the selected text

Sampson
  • 265,109
  • 74
  • 539
  • 565
Jack Thor
  • 1,554
  • 4
  • 24
  • 53

0 Answers0