Skip to content
Advertisement

Is it possible to limit text selection to current element?

JavaScript

Is it possible (by any HTML node, CSS or JS) to prevent from selecting text in div.item2 if selection started from text in div.item1 and the other way around – starting from div.item2 and limit to it (prevent item1 form being selected)?

Advertisement

Answer

I came up with this, with a bit of jQuery code :

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement