且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用 jQuery UI 获取被拖动元素的子元素

更新时间:2022-06-16 06:36:59

你可以使用:

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

这将在可拖动元素的所有后代中查找 a 元素.

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')