How to get the child of an element being dragged with jQuery UI

后端 未结 2 1413
走了就别回头了
走了就别回头了 2021-01-26 09:34

I have the following html:

2条回答
  •  离开以前
    2021-01-26 09:48

    You can use:

    ui.draggable.find('a').attr('href')
    

    This will look for the a element among all descendants of the draggable element.

    To look only at the direct children of the draggable, use this instead:

    ui.draggable.children('a').attr('href')
    

提交回复
热议问题