So, I have two contenteditable divs nested inside of another:
<div class="top" contenteditable="true">
<div class="nested" contenteditable="true">This</div>
</div>
Here is Fiddle.
When it is focused, nested
should be focused but using console.log(document.activeElement);
it shows that the top
is focused and it doesn't recognize the nested
div.
In a case where content is being edited, I need to recognize nested
div element instead of the top
element.
How would I achieve this? Any help will be much appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…