我有一個按鈕<button id="subs1">test</button>
和一個divjQuery的 - .removeClass不起作用
<div class="subsystem subhide">
<h3 style="text-align: center; font-size: 30px; font-weight: normal;">Electronics</h3>
<p>Lorem</p>
</div>
在CSS文件中的類.subhide被定義爲
.subhide {
display: none;
}
和jQuery的代碼,我'試圖去工作是
jQuery('#subs1').on('click', function(){
jQuery('.subsystem').removeClass('subhide');
});
當點擊按鈕什麼都沒有發生,爲什麼?
在此先感謝!
您可以檢查是否有錯誤還可以創建一個演示? – guradio
子系統的作用是什麼?請添加子系統CSS請 – hamzox
您是否包含jQuery庫? – Dekel