Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试确定页面上的任何表行(包括 AJAXed 内容)是否具有“透支”类,如果页面上的 ANY 有,则隐藏某个按钮。这是我正在使用的代码,但它不起作用。我不知道我使用的代码是否考虑了动态数据,或者它是否只在页面加载时运行。
(function() { if( $('tr').hasClass('overdraft'){ $('#btnSAMSubmit').hide(); } // end if })();
乍一看,你错过了一个)
)
if( $('tr').hasClass('overdraft')) // <-- This last ) is missed on your code { $('#btnSAMSubmit').hide(); }
if( $('.overdraft').length > 0) { $('#btnSAMSubmit').hide(); }