<div class="target"></div>
.target {
width: 100px;
height: 100px;
background: blue;
border-radius: 0px;
transition: border-radius 0.5s;
}
.round {
border-radius: 50px;
}
const div = document.querySelector('.target');
div.addEventListener('click', function() {
this.classList.toggle('round');
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.