我有这样的html结构:
<div class="dk_options">
<ul class="dk_options_inner">
<li class="dk_option_current"><a data-dk-dropdown-value="">Select State</a></li>
<li class=""><a data-dk-dropdown-value="1">AK</a></li>
<li class=""><a data-dk-dropdown-value="2">AL</a></li>
<li class=""><a data-dk-dropdown-value="3">AR</a></li>
<li class=""><a data-dk-dropdown-value="4">AZ</a></li>
<li class=""><a data-dk-dropdown-value="5">CA</a></li>
<li class=""><a data-dk-dropdown-value="6">CO</a></li>
</ul>
</div>
我想获取标签属性 data-dk-dropdown-value 的值。我的代码总是显示为空
var a=jQuery('#dk_container_businessState .dk_options ul li a').attr('data-dk-dropdown-value');
alert(a);