I have a code like this:
<button onmousedown="alert('Hi!');">Some text</button>
But when I try to long click it (that’s why I put onMouseDown
event), my text is selected instead of only execute my script. How can I prevent my text from being selected when trying to execute onMouseDown
event?