JSFiddle - React, Tailwind, and code Playground
HTML
<img src="https://joomla-support.ru/data/avatars/m/19/19321.jpg?1394998565" width="96" alt="woojin" onclick="BigSmall(this)">
JavaScript
function BigSmall(pic) {
var style = pic.style.width;
var attr = pic.getAttribute("width");
var real = pic.width;
var width, newWidth;
if (!style && !attr) {
width = real;
} else if (!style) {
width = attr;
} else {
width = style;
}
width = parseInt(width);
pic.removeAttribute("width");
pic.style.removeProperty("width");
if (width == 200) {
newWidth=96;
} else {
newWidth=200;
}
pic.style.setProperty("width", newWidth+"px");
}