JSFiddle - React, Tailwind, and code Playground

HTML

<img id="my_text" src="
http://i75.fastpic.ru/big/2015/1224/e7/7a07ba77383cd37f44
d692a975c988e7.jpg" width="100px">

<h2 onclick="my_func()">Выполнить функцию</h2>

CSS

#my_text{
  transition-duration: 2s
}

h2 {
	cursor: pointer;
	text-decoration: underline;
}

JavaScript

function my_func() {
	var  img = document.getElementById("my_text");
	img.setAttribute("width","200px");
	
}