Draggable and Clickable input element using jquery

前端 未结 4 1000
抹茶落季
抹茶落季 2021-01-06 17:44

I have an input element inside a draggable div. My code should do the following things:

  • When I drag my input element, entire draggable div should be dragged. (
4条回答
  •  花落未央
    2021-01-06 18:28

    $('.draggable input').click(function() {
        $(this).focus();
    });
    

    The input field is now editable, and you can still drag the whole div from the input field. JSFiddle.

提交回复
热议问题