gpt4 book ai didi

javascript - $(this).attr ("href") 不工作

转载 作者:太空宇宙 更新时间:2023-11-04 13:32:02 25 4
gpt4 key购买 nike

出于某种原因,这行代码返回 undefined for $(this).attr("href")

$("a").attr("href", "javascript:page('" + $(this).attr("href") + "')");

我怎样才能得到那个值?

最佳答案

$("a").click(function(e){
e.preventDefault();
page(this.href);
});

关于javascript - $(this).attr ("href") 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11295852/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com