JavaScript/jQuery get current selected text inside iframe

My Iframe looks like this

<iframe id="myId" class="af_richTextEditor_content-input" frameborder="0" style="height:     36em;" src="/blank.html">
    <html>
        <head>
            <title></title>
        </head>
        <body dir="ltr" style="margin: 0px; padding: 1px; font-size: small; font-family: Tahoma,Verdana,Arial,Helvetica,FreeSans,sans-serif; -moz-box-sizing: border-box;">
            myText
            <br>
            MySecondText
        </body>
    </html>
</iframe>

This iframe behaves like textarea (it is like input field) and I can write text into it and select some text inside. Now When button is pressed I want to get selected area (start position and end position of body tag selection). How to? JQuery? Pure JS? Examples?

newest questions tagged jquery – Stack Overflow

About Admin