JSFiddle - React, Tailwind, and code Playground

by Timmy Willison

HTML

<div id="test">
    <a href="#">First Child</a>
    <a href="#">Second Child</a>
</div>

JavaScript

var parent = $('#test');

parent.delegate('a:first', 'click', function(e){
    e.preventDefault();
    console.log('clicked on the first child');
});