我有以下html和css。在css中,我为按钮设置了 display:none 。由于此表单正在其他页面上共享,我想使用jquery在某些页面上显示此按钮。我尝试使用 $(“。ui-multiselect.ui-widget.ui-state-default.ui-corner-all”)。show() 但是它没有真正起作用。有人可以告诉我,如果我在这里做错了。
$(document).ready(function() {
$(".ui-multiselect.ui-widget.ui-state-default.ui-corner-all").show();
});
#userSearchForm .ui-multiselect {
position: absolute;
right: 31px;
top: 26px;
z-index: 100;
}
#userSearchForm .ui-multiselect {
display: none;
}
#userSearchForm button {
float: right;
margin-right: 13px;
}
<form method="post" action="bulkOperations.html?execution=e23s1" id="userSearchForm">
<select multiple="multiple" autocomplete="off" name="userSearchBean.searchCriteria" id="searchFilter" style="display: none;"><option value="userStatus">User status</option><option value="accountStatus">Account status</option><option value="maidenName">Maiden Name</option></select>
<button type="button" class="ui-multiselect ui-widget ui-state-default ui-corner-all" aria-haspopup="true" style="width: 231px;"><span class="ui-icon ui-icon-triangle-2-n-s"></span><span>Add More Search Criteria</span></button><input type="hidden" value="1" name="_userSearchBean.searchCriteria" autocomplete="off">
<table width="100%" cellspacing="1" id="userSearchFormTable" class="yui">
<thead>
<tr>
<td colspan="2">
<div class="info center" style="position:relative;">All searches use a 'starts with' algorithm</div>
</td>
</tr>
</thead>
<tfoot>
<tr>
<td class="filter" colspan="2">
<input type="submit" value="Search" name="_eventId_searchUsers" class="redBtn" id="searchUsers" autocomplete="off">
<a id="cleanUserSearchForm" class="whiteBtn" href="javascript:void(0);">Clear</a>
</td>
</tr>
</tfoot>
</table>
</form>