我有一个对话-
<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/