当前位置:Gxlcms > JavaScript > [jQuery]循环遍历改变a标签的href

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

时间:2021-07-01 10:21:17 帮助过:7人阅读

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

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

以上就是[jQuery]循环遍历改变a标签的href的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行