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

后端 未结 2 1392
走了就别回头了
走了就别回头了 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')
    
    0 讨论(0)
  • 2021-01-26 09:55

    Try this:

    $(this).children('a').attr("href");

    Does that work for you?

    0 讨论(0)
提交回复
热议问题