Q: How can I prevent my image from opening when long click 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 onMouseDownevent), 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?

A: You can use user-select: none property for that . So text is not selected by user
