jQuery Mobile-无法使用常见的jQuery方法隐藏按钮

jQuery Mobile - Cannot hide a button using common jquery methods

本文关键字:jQuery 方法 隐藏 按钮 常见 Mobile-      更新时间:2023-09-26

我有一个非常简单的按钮,我想隐藏

<input type="button" id="logoutBtn" value="logout" 
       data-theme="d" data-inline="true" aria-disabled="false">

我正在使用这个简单的调用来尝试隐藏它,但它对没有任何作用

$('#logoutBtn').hide();

所以我试着添加这个,但也不起作用。

$('#first').live('pageinit', function(e){
      $('#logoutBtn').hide();
});

我做错了什么?

jquery mobile的可能重复无法隐藏提交按钮

<div data-theme="e" class="ui-btn ui-btn-inline ui-btn-corner-all ui-shadow ui-btn-hover-e ui-btn-down-e" aria-disabled="false">
    <span class="ui-btn-inner ui-btn-corner-all">
        <span class="ui-btn-text">Submit</span>
    </span>
    <input type="submit" id="logoutBtn" value="button" data-theme="e" data-inline="true" class="ui-btn-hidden" aria-disabled="false">
</div>
$('#logoutBtn').closest('.ui-btn').hide();