如何点击锚标记li
<a>
班级名称
<li class="active">
<a href="#pending" data-toggle="tab" title="Pending" onclick="loadBolttCommunityData('pending')">
<span class="round-tabs two">
<i class="glyphicon glyphicon-info-sign"></i></span>
</a>
</li>
答案 0 :(得分:1)
您可以使用jquery attr
方法获取父li,并使用<li class="active">
<a class="foo" href="#pending" data-toggle="tab" title="Pending" onclick="loadBolttCommunityData('pending')">
<span class="round-tabs two">
<i class="glyphicon glyphicon-info-sign"></i>
</span>
</a>
</li>
<script type="text/javascript">
$('.foo').on('click',function(){
$(this).parent('li').attr('class');
})
<script>
方法获取其类名。
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"