jQuery 循环遍历改变a标签的href | 实例讲解

jQuery 循环遍历改变a标签的href | 实例讲解

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

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

以上这篇jQuery 循环遍历改变a标签的href(实例讲解)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

tag:循环遍历标签实例电脑软件

相关内容