JSFiddle - React, Tailwind, and code Playground

by Reigel Gallarde

HTML

<a href="#" rel="a">a</a>
<a href="#" rel="b">b</a>
<a href="#" rel="c">c</a>
<a href="#" rel="d">d</a>
<a href="#" rel="e">e</a>
<a href="#" rel="f">f</a>

JavaScript

$("a").click(function(eve) {
    eve.preventDefault();
    
    
    alert($('a').attr('rel')); // would take all <a>'s but only alerts the first one. well, not always, defends on the browser I think.
    
    
    //alert(this.rel); // `this` would mean the current object.

});