How to add / remove CSS class dynamically in jQuery

How to add / remove CSS class dynamically in jQuery

瀏覽:377
日期:2026-04-19
jQuery comes with addClass() and removeClass() to add or remove CSS class dynamically. For example, $(‘#para1′).addClass(‘highlight’); – Add a “highlight’ css class to elements that contain id of “para1″. $(‘#para1′).removeClass(‘highlight’); – Remove a “...看更多