There are several divs. I need to change the radius of the border using the click event. I managed to change the radius of the border only once. When someone clicks on a div, the radous border should be changed to 50%, and again click on the same div, the applicable border radius should delete.
And while there is a border that changed the div, and if you click on another div border of the changed div, you need to remove it and the radius of the border should be applied to the pressed div. This means that there should be only one border radius at a time.
I have this code
jsfiddle
HTML
<div></div> <div></div> <div></div> <div></div>
And this is css
div { width: 100px; height: 100px; background: #000; margin: 10px; float: left; }
also this jquery code
$('div').each(function(){ $(this).click(function(){ $(this).css('border-radius', '50%'); }); });
please help me about this .. i have no idea how to do this ..
source share