JSFiddle - React, Tailwind, and code Playground

by lgedeon

HTML

<label for="foo">Label:</label>
<input type="button" id="foo" value="Click the label, not me!">
<script>
var clickCount = 0;
document.getElementById('foo').addEventListener('click', function(e) {
  console.log(e);
  clickCount += 1;
  this.value = 'YOU CLICKED ME!! ' + String( clickCount ) + ' time(s)';
}, false);
</script>