JSFiddle - React, Tailwind, and code Playground

by abdul quadir

HTML

<div id="poc"> <a href="http://google.co.in">Yoo</a>
<a href="resturant/burger" />Click Me</a>
</div>

JavaScript

$(document).ready(function () {
    $("#poc a").each(function (index) {

        $(this).attr('name', $(this).attr('href'));
        console.log($(this).attr('name'));
        $(this).attr('href', '#');
        $(this).click(function (e) {
            alert($(this).attr('name'));
        });


    });


});