gpt4 book ai didi

Javascript - 使用重置按钮隐藏 div

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

我需要一个 UL,其中包含按下重置按钮后要隐藏的搜索结果 (ul.job_listings)。到目前为止,已经设置了重置来重置搜索表单:

$( '.job_filters' ).on( 'click', '.reset', function () {
var target = $( this ).closest( 'div.job_listings' );
var form = $( this ).closest( 'form' );

form.find( ':input[name="search_keywords"], :input[name="search_location"], .job-manager-filter' ).not(':input[type="hidden"]').val( '' ).trigger( 'chosen:updated' );
form.find( ':input[name^="search_categories"]' ).not(':input[type="hidden"]').val( 0 ).trigger( 'chosen:updated' );
$( ':input[name="filter_job_type[]"]', form ).not(':input[type="hidden"]').attr( 'checked', 'checked' );

target.triggerHandler( 'reset' );
target.triggerHandler( 'update_results', [ 1, false ] );
job_manager_store_state( target, 1 );

return false;
} );

我如何添加它来隐藏结果 div?

感谢您的帮助,莉兹。

最佳答案

由于您似乎正在使用 jQuery,因此您可以添加

target.hide();

return语句之前。

<小时/>

编辑 - 请参阅上面的评论:-)

关于Javascript - 使用重置按钮隐藏 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38547155/

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