Want to split the tag by two. I have the tag like this
<span class="ss" custom-attr="kk"> split content here, and have to split </span>
If I select the content and have
and click a button, I want to split a tag like this. Even span contains many attributes. I want to split with that attributes.
<span class="ss" custom-attr="kk"> split content here, </span>and have <span class="ss" custom-attr="kk">to split </span>
i can get the selected text by using window.getSelection()
.
ex: https://jsfiddle.net/rx5ojfwc/