The addClass()
method adds one or more class names to selected HTML elements. This method helps with changing the CSS properties of these HTML elements at a later stage. However,
it does not remove existing class attributes; instead, it adds only one or more class names to the existing class attribute.
The following example demonstrates the use of the addclass()
function. Upon clicking the button, the newclass
class gets assigned to it, thus, changing the button’s CSS properties.
Free Resources