jQuery addClass example
Change class name on click in jQuery
HTML
<div class="section"></div>
CSS
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
margin: 0;
}
.section {
width: 40px;
height: 60px;
background-color: #0084ff;
transition: 250ms;
}
.section.scale {
width: 50px;
height: 70px;
}
JavaScript
$('.section').on("click", function(){
$(this).toggleClass("scale")
})