距开课0天0时0分-10251502秒
大家讲道理2016-11-12 14:46:32 0 2 352
[PHP讨论组]举报回复话题 ↕
请问a标签onlick事件获取当前data-name
2
0
分享
代言 2016-11-12 14:46:592楼
$(this).attr('data-name');
赞 +0添加回复
代言 2016-11-12 14:46:521楼
绑定事件的时候把this传进去,onclick="choose(this)"
function choose(x){ alert(x.getAttribute("data-name")) }
代言 2016-11-12 14:46:592楼
$(this).attr('data-name');
赞 +0添加回复
代言 2016-11-12 14:46:521楼
绑定事件的时候把this传进去,onclick="choose(this)"
赞 +0添加回复