How do I find out the DOM node when select text in a browser’s editable content window using Javascr

Posted by chanthou on Stack Overflow See other posts from Stack Overflow or by chanthou
Published on 2010-03-24T08:29:40Z Indexed on 2010/03/24 8:33 UTC
Read the original article Hit count: 191

Filed under:
|
|
|
|

I want to get parentElement when I select some text in iframe.

iframe = document.getElementById("iframe"); function getParentElement(){ var sel=iframe.contentDocument.getselection(); return sel.parentElement() } getParentElement();

when I run this code it show Error:" TypeError: iframe.contentDocument.getSelection().parentElement is not a function { message="iframe.contentDocument....ement is not a function", more...}"

Please give me a help!

© Stack Overflow or respective owner

Related posts about parent

Related posts about element