Prevents texts being selectable in Jquery

So in some situations it is needed to prevent user from selecting text in web page.

So it will play nice in some situations like drag and drop.

So it can be done using Jquery.


$('p').attr('unselectable', 'on')
.css('user-select', 'none')
.on('selectstart', false);

Code pen

Could not load file or assembly ‘Newtonsoft.Json, Version=6.0.0.0, or one of its dependencies. The system cannot find the file specified.

Could not load file or assembly ‘Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’ or one of its dependencies. The system cannot find the file specified.

I got this error when I added to WEB API to ASP.NET MVC project.

So This is how I get it solved

Run this command in package manager console

Update-Package –reinstall Newtonsoft.Json