【发布时间】:2015-08-12 22:44:28
【问题描述】:
如何在引导轮播中找到(检测)数据属性的值。
例如
<div class="item" data-slide-number="2" data-nexttopic="T0024">
<div class="topic-content">
我需要检索下一个主题的值
我会想一些类似的东西
var topicValue = $(e.relatedTarget).find("[data-nexttopic]").val();
【问题讨论】:
-
尝试 attr() 代替 var topicValue = $(e.relatedTarget).attr("data-nexttopic").val();
标签: jquery twitter-bootstrap custom-data-attribute