How to select the input value in a drag element

<div draggable="true">
    <input />
</div>

if input is worth it and cannot be selected by mouse, div will be dragged

it is not valid to add draggable= "false" to the input element;

May.22,2021

JSBIN
< del > wrote a Demo, for you to study. < / del >

there is a problem. Let me fix it (just a moment

). < hr >

found a hack solution.
JSBIN

judge the target attribute of mouseEvent in onmousedown to dynamically add dragable

.
Menu