title: How to tell where highlighted text exists
body: <p>I've got a screen that has an outer frame with some text on it, and then an iframe which shows screens that have text on them. I want to create a custom "File" menu that has items like cut,copy,paste, print, etc. I know that you can execute cut,copy,paste commands by calling</p>
  
  <pre><code>document.execCommand("cut");
  </code></pre>
  
  <p>if I want to cut something in the parent frame. And if I want to cut something inside the iframe I can do</p>
  
  <pre><code>document.getElementById("myIframe").contentWindow.document.execCommand("cut");
  </code></pre>
  
  <p>Since the File menu is going to be living in the parent, I need to be able to differentiate highlighted text in the parent frame vs the iframe so that I know which javascript code to execute.</p>