-1

I need to know: with some of what position people select the text and add text around it full of tag with his class.

Wherein: report should be based on HTML tags without such as span and link (a)

Example: enter image description here

serge
  • 391
  • 1
  • 3
  • 9

1 Answers1

0

I marked this as a duplicate but the comment afterwards meant a response may be needed.

If you look at the only answer here: Get the highlighted text position in .html() and .text()

you will find that there is mention of

Reference

.wrap()

.before()

.after()

You should be able to use those along with the second part of the answer to add in any tags you want to the selected text.

Community
  • 1
  • 1
Kenneth Salomon
  • 1,352
  • 11
  • 18
  • Unfortunately, what you're saying, I do not quite fit. I have good examples, for me [this](http://jsfiddle.net/LgCjT/1/), and [this](http://jsfiddle.net/UuDpL/2/) but here there is no accounting html tags and return values. – serge Aug 06 '15 at 14:37
  • Are you saying you no longer need an answer or you still need help? I believe the link I provided should help you get an element in JavaScript that you can then use the `.before()` and `.after()` functions to add tags before and after the selection instead of highlighting the selection – Kenneth Salomon Aug 06 '15 at 14:38