How would I split a node/element at a position (selection).
Example I have this markup:
<p>This is <a href="">a te|st</a>, you like?</p>
(this pipe represents the position/selection)
I want to convert it to:
<p>This is <a href="">a te</a></p>|<p><a href="">st</a>, you like?</p>
Maintaining the selection.
Any ideas?
I and using the Rangy library, and also jQuery, but can use raw JS if applicable.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…