how to get innerHTML from range's start and end in DIV in JavaScript

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



how to get innerHTML from range's start and end in DIV in JavaScript



How to get innerHTML from parent DIV and the innerHTML stop at selected word?



like example, I will get the result alert innerHTML of This select some <b>is a <i>some, if I selected the 'asx' word.


This select some <b>is a <i>some



Thank you




function selected(element) element.document;
var win = doc.defaultView


<div id="editor" contenteditable="true">This select some <b>is a <i>some asx</i> sdc</b> select some text in some here.</div>
<button type="button" onclick="selected(document.querySelector('#editor'))">edit</button>





stackoverflow.com/q/4652734
– IVO GELOV
Aug 6 at 14:49









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS