gpt4 book ai didi

jQuery - 动态隐藏/显示对话框上的按钮

转载 作者:太空宇宙 更新时间:2023-11-04 00:16:08 24 4
gpt4 key购买 nike

我有一个对话-

<div data-role="dialog" id="msg-popup">
<div data-role="header">
<h1>Notification</h1>
</div>

<div data-role="content" id>
<b id="notif-subject"></b>
<a href="#notif-details1" id:"show-notif" data-role="button">Show notification</a>
<a href="#" data-rel="back" data-role="button">Cancel</a>
</div>
</div>

我想使用 jquery 代码动态地隐藏和显示 show-notif 按钮。我该怎么做?

我试过了

$("#show-notif").hide(); 

这对我不起作用。有什么想法吗?

最佳答案

似乎有一个小的语法错误:

<a href="#notif-details1" id:"show-notif" data-role="button">Show notification</a>

它应该是(将 : 替换为 =):

<a href="#notif-details1" id="show-notif" data-role="button">Show notification</a>

这些函数应该可以工作:

$('#show-notif').hide();
$('#show-notif').show();

关于jQuery - 动态隐藏/显示对话框上的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11193002/

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