How to add / remove CSS class dynamically in jQuery

How to add / remove CSS class dynamically in jQuery

瀏覽:396
日期:2025-12-17
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 “...看更多