JSFiddle - React, Tailwind, and code Playground
HTML
<a href="javascript:void(0);" data-icol="[1]" id="name">Show Name</a>
JavaScript
$(function(){
$('#name').click(fnShowHide);
});
function fnShowHide()
{
var iCol = $(this).data('icol'); //will give [1]
console.log(iCol);
//Your code
$(this).text(function(_, text) { //now this refers to the element clicked
return text === 'Show Name' ? 'Hide Name' : 'Show Name';
});
}