html
<dd class="col-sm-11"> <a href="http://beijing.example.com">北京</a> <a href="http://tianjin.example.com">天津</a> <a href="http://shanghai.example.com">上海</a> <a href="http://chongqing.example.com">重庆</a></dd>我想把所有链接提取出来:
<script> $(function () { var hrefs = $('a').attr("href"); console.log(hrefs); });</script>浏览器控制台没有显示任何东西,要怎么才能打印?
相似问题