JSFiddle - React, Tailwind, and code Playground

HTML

<div id="a"></div>
<div id="b"></div>
<div id="c"></div>

CSS

div {
  height: 200px;
  margin: 10px 0
}

#a {
  background: red
}

#b {
  background: black
}

#c {
  background: green
}

JavaScript

var divA = document.getElementById('a');
var divB = document.getElementById('b');
var divC = document.getElementById('c');

divA.onclick = function(e) {
  this.style.width = 300 + 'px';
}
divB.onclick = function(e) {
  this.style.width = 600 + 'px';
}
divC.onclick = function(e) {
  this.style.width = 900 + 'px';
}