用Jquery如何只取返回的值是数字
下面是网页脚本,页面显示有5页和下一页,现要获取1,2,3,4,5数字页码,用Jquery怎么写?<divclass="pager"><strong><span>1</s...
下面是网页脚本,页面显示有5页和下一页,现要获取1,2,3,4,5数字页码,用Jquery怎么写?
<div class="pager">
<strong><span>1</span></strong>
<a rel="external nofollow" href="/sj/can/2/"><span>2</span></a>
<a rel="external nofollow" href="/sj/can/3/"><span>3</span></a>
<a rel="external nofollow" href="/sj/can/4/"><span>4</span></a>
<a rel="external nofollow" href="/sj/can/5/"><span>5</span></a>
<a rel="external nofollow" href="/sj//2/" class="next"><span>下一页</span></a>
</div> 展开
<div class="pager">
<strong><span>1</span></strong>
<a rel="external nofollow" href="/sj/can/2/"><span>2</span></a>
<a rel="external nofollow" href="/sj/can/3/"><span>3</span></a>
<a rel="external nofollow" href="/sj/can/4/"><span>4</span></a>
<a rel="external nofollow" href="/sj/can/5/"><span>5</span></a>
<a rel="external nofollow" href="/sj//2/" class="next"><span>下一页</span></a>
</div> 展开
2个回答
展开全部
请问你是要获取指定的页码还是获取全部页码?
获取全部包含 下一页
$('.pager span').text()
获取全部数字不包含下一页
$('.pager span').not(':last').text()
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询