JSFiddle - React, Tailwind, and code Playground

by Yogesh Salgar

HTML

<p>Some random text.</p>
<p>More blah. <img id="someImage" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Deletion_icon.svg/600px-Deletion_icon.svg.png"/> More blah.</p>
<p>Some random text.</p>

CSS

#someImage { width:32px; height:32px; }
.active{
    transform : scale(2.1);
    transition: 1s ease all 0s;
}
.deactive{
    transform : scale(1);
    transition: 1s ease all 0s;
}

JavaScript

$(function(){
    $('img').click(function(){
        if($(this).hasClass("active")){ 
            $(this).addClass("deactive");
            $(this).removeClass("active");
        }else{
            $(this).removeClass("deactive");
            $(this).addClass("active");
        }
    });
});