我目前有一个页面,其中包含多个元素,类“链式”。我想使用一个类选择器,这样我就可以选择所有这些,并根据一些数据属性运行一些额外的代码(每个元素都会不同)。到目前为止,我的代码是:
$('.chained_child').remoteChainedTo('chained_parent'
+ $(this).data('chained-parent'), $(this).data('chained-url'));
我相信问题出在这部分:$(this).data('chained-parent')
- 这似乎不起作用。如何选择所选元素的数据属性?
谢谢!