$('.storeUrl a').each(function(){
var Ahref =
$(this).attr('href');
Ahref = Ahref + "?longitude="+longitude + "&latitude=" + latitude;
$(this).attr("href",Ahref);
});
li标签添加class="storeUrl",用each遍历li标签下的a;
定义Ahref为获取到的a标签href地址;
给href添加经纬度参数;
把Ahref赋值给a标签的href。
最后
以上就是英勇诺言最近收集整理的关于jQuery遍历li下的a标签,添加参数的全部内容,更多相关jQuery遍历li下内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复