JSFiddle - React, Tailwind, and code Playground

by fguillen

HTML

<a href="/pepe" class="bb_link">pepe</a>
<a href="/pepe2" class="bb_link">pepe2</a>

JavaScript

$("a.bb_link").each( function( index, link ){
  console.log( "link", link );
  $(link).click( function( event ){
    event.preventDefault();
    url = $(this).attr( "href" );
    console.log( "url", url );
  });
});