DEV Community

Cover image for Script to Mark Text in article
Alex
Alex

Posted on

Script to Mark Text in article

Hi guys! My first post here, and this is my script what let user to mark text of the article that he find interesting or useful.

Alt Text

On text selection under cursor will appear block with 2 buttons - mark text and copy text.

If user clicked on 'mark text' - selected text will be surrounded with <mark> tag and highlighted. Also all text, what user marked will be collected into list in bottom right corner:

Alt Text

Nothing special with "copy text" button - it just copies text :)

Idea for this script comes to my mind when I worked on site for sea mans, where articles are big and very hard to read.

JSFIDDLE https://jsfiddle.net/Lestrae/po931gmq/12/

I know one bug in this script, but I hope you don't find it :D

Top comments (0)