JSFiddle - React, Tailwind, and code Playground
by serio
HTML
<div>
<a href='#'>foo</a>
<a href='#'>bar</a>
<a href='#'>wee</a>
</div>
JavaScript
$('a').bind('click', function(e) {
if ($(this).next().length !== 0) {
alert('something is next to me!');
}
else {
alert('i am alone in the universe');
}
});