gpt4 book ai didi

javascript - 显示/隐藏文本 JQuery

转载 作者:行者123 更新时间:2023-12-03 12:43:28 25 4
gpt4 key购买 nike

我有这段代码,具有文本显示/隐藏功能,现在“显示文本”和“隐藏文本”都是可见的,有人知道如何让链接也显示和隐藏吗?

$(document).ready(function(){
$("#hide").click(function(){
$(".content_post").hide();

});

$("#show").click(function(){
$(".content_post").show();
});
});

最佳答案

这也应该有效

$(document).ready(function(){
$("#hide").click(function(){
$(".content_post").hide();
$(this).hide();
$("#show").show();

});
$("#show").click(function(){
$(".content_post").show();
$(this).hide();
$("#hide").show();
});
});

关于javascript - 显示/隐藏文本 JQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23433871/

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