JSFiddle - React, Tailwind, and code Playground
HTML
<div class="MenuItem">Item1</div>
<div class="MenuItem">Item2</div>
JavaScript
$('.MenuItem').click(function() {
document.writeln($(this).html() + ' was clicked');
});
//I want to trigger click and identify the item that has been clicked. Normally, I just use
//the this object, but on a trigger I don't know how to assign this so .html() functions.
//This doesn't work as intended.
$('.MenuItem').eq(1).click();