JSFiddle - React, Tailwind, and code Playground

by wiltomap

HTML

<button id='monBouton'>
  TEST
</button>

JavaScript

$('#monBouton').click(function() {

	// Changement de l'attribut style du bouton (passage du texte en bleu)
  $(this).attr('style', 'color: blue');
  
  // Récupération et affichage de l'id du bouton
  var myThis = $(this).attr('id');
  alert(myThis);

});