A simple solution would be to disable the selection of text in the corresponding element. To prevent the use of the arrow keys, select more.
To prevent tekst from being selected, you need event.preventDefault()
in the mousedown event using JS.
For your violin, which might look like this in modern standards-compliant browsers:
// give the div an id document.getElementById('div').addEventListener('mousedown', function(e) { e.preventDefault(); }, false);
Edit
Or, as @JimThomas noted in the comments, you can turn off text selection using CSS, of course, this is not as much as JS support. How to disable text selection highlighting using CSS?
I could not think of a more elegant or more complete (this does not solve the problems that may arise with input), and I am not sure that there is even ...
source share