JSFiddle - React, Tailwind, and code Playground
HTML
<img src="https://c7.staticflickr.com/3/2538/3742771246_2648fa4e6e_b.jpg" onClick="swap(this)" onmouseover="" style="cursor: pointer;" height="100" width="100">
<script>
function swap(img)
{
debugger;
if (img.width===100)
{
img.style.height = 'auto';
img.style.width = 'auto';
}
else
{
img.style.height = '100px';
img.style.width = '100px';
}
}</script>