Chrome Extension

Add class to element jQuery


$("button").click(function() {

Do you know, you can create and search your own code snippets on Devsheet. Store your code on cloud using devsheet and search using its chrome extension. Is it look cool?

.addClass() method is used in jQuery to add a CSS class on HTML Element. In the above example, we have added a class named 'hello' on the div element and also on button click.

Search Index Data (The code snippet can also be found with below search text)

.addClass() jQuery
Was this helpful?
Never leave your website again in search of code snippets by installing our chrome extension.