美文网首页
选择div下id为topic-type的a标签的值

选择div下id为topic-type的a标签的值

作者: _FireFly_ | 来源:发表于2020-12-02 08:55 被阅读0次

    html代码:

      <div class="fly-panel-title fly-filter" id="topic-type">
                        <a href="${pageContext.request.contextPath}/jie/index/${cid}/0" class="layui-this">综合</a>
                        <span class="fly-mid"></span>
                        <a href="${pageContext.request.contextPath}/jie/index/${cid}/1">未结</a>
                        <span class="fly-mid"></span>
                        <a href="${pageContext.request.contextPath}/jie/index/${cid}/2">已结</a>
                        <span class="fly-mid"></span>
                        <a href="${pageContext.request.contextPath}/jie/index/${cid}/3">精华</a>
                        <span class="fly-filter-right layui-hide-xs">
                        <a href="" class="layui-this">按最新</a>
                        <span class="fly-mid"></span>
     </div>
    

    js代码:

    $('#topic-type').find('a').eq(${typeid}).addClass('layui-this').siblings().removeClass('layui-this');
    

    相关文章

      网友评论

          本文标题:选择div下id为topic-type的a标签的值

          本文链接:https://www.haomeiwen.com/subject/ptazxctx.html