[jQuery]循环遍历改变a标签的href

把info类下面所有的a标签链接后天加"#article"。

jQuery(document).ready(function($){
  $('.info a').each(function(){
    let Ahref = $(this).attr("href") + "#article";
    $(this).attr("href",Ahref);
  });
});

posted @ 2017-07-11 22:08  阳癫疯  阅读(1729)  评论(0编辑  收藏  举报