I could use some assistance with this task. I want to create a functionality where clicking on the text/icon causes the + icon to rotate 45 degrees, resembling an x icon. With each subsequent click, the icon should alternate between the + and x shapes.
Any assistance offered would be greatly valued!
JSFIDDLE
https://jsfiddle.net/d264kt2t/
HTML
<div class="container">
<div class="pointer">
CLICK ME<img src="http://www.ssglobalsupply.com/images/plus.png" class="coolImage">
</div>
</div>
CSS
.container{
width:100%;
padding-top:100px;
padding-bottom:100px;
background-color:#000;
}
.coolImage{
height:17px;
width:17px;
margin-left:7px;
}
.pointer{
cursor:pointer;
text-align:center;
font-size:20px;
color:#fff;
}