JSFiddle - React, Tailwind, and code Playground
HTML
<div>one</div>
<div>two</div>
<div>three</div>
<div>four</div>
JavaScript
$('div').click(function() {
//do something different based on whether even or odd div
if ($(this).is(':even')) {
$(this).html('even');
} else {
$(this).html('odd');
}
});