I have a p-tag for showing the article which contains two types -
words you don't need to change and words you can select in it. E.G.
<div class="context">
<p v-html="report_data" class="showTxt" id="showTxt" contenteditable="true"></p>
</div>
and I wanna make a window for showing the result which user selected and also include others don't need to change.
** rr = $('#showTxt option:selected').text()
this way would delect other word don't need to change
r_content = document.getElementById('showTxt').textContent
and this way would show everything include all option
thanks in advance
Your question is not clear to me, but I guess you want to get the text user selected. If so you can use getSelection.
window.getSelection().toString();