there is an input box in this picture, and then I want to double-click and replace the text , but it is obvious that before replacing the text, the original text will be selected by the default event of mouse double-click , which can be said to be quite ugly.
so it involves masking the browser default event .
I tried. Binding the double-click event on the current control, that is, the input element, and then neither preventDefault nor stopPropagation nor return false, can prevent the default event of double-clicking selected text
on the document object, you can block
by returning false directly. < H2 > here comes the problem < / H2 >- can you only tamper with double-click events of document objects by blocking double-click selected events like this? Can
- block this event by calling the function of the event object of the current element?
Note: onselectstart= "return false;" and css cannot be used, because the operation of dragging the mouse to select text cannot be shielded