How to add / remove CSS class dynamically in jQuery

How to add / remove CSS class dynamically in jQuery

瀏覽:746
日期:2024-05-27
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 “...看更多