I have a div with class of .ban2 and id of #banner2.
I want to change the border-radius property of this div whenever I click on the div itself. Like when iI click it for the first time the border-radius becomes 0 and when I click again it goes back to 50% 0 0 50%.
I want to toggle between these 2 styles. in my .ban2Toggle class I have all the styles included, but the border radius is 0.
it is only working once like when I click it for the first time the border radius becomes 0. The next time I click it I don't know how to get it back to normal.
.banner .ban2{
position: absolute;
right: 0;
top: 0;
width: 40%;
height: 63vh;
background: #5a0980;
border-radius: 50% 0 0 50%;
transform: scaleY(1.6);
display: flex;
justify-content: center;
align-items: center;
transition: 1s ease;
}
$('#banner2').on('click', function(){
$('#banner2').removeClass('ban2');
$('#banner2').addClass('ban2Toggle');
});