JSFiddle - React, Tailwind, and code Playground
by learner001
HTML
<a href="#" class="ghost_ab" data-id="GHOST1" data-action="alert1">Link1</a>
<a href="#" class="ghost" data-id="GHOST2" data-action="alert2">Link2</a>
<a href="#" class="ghost_ab" data-id="GHOST3" data-action="alert3">Link3</a>
JavaScript
$(document).ready(function(){
$(".ghost_ab").on("click", function(e){
e.preventDefault();
var id = $(this).data("id");
var action = $(this).data("action");
console.log('aatman');
alert("ID= "+id+"::Action="+action);
/*** code used to pass id to another page
$.ajax({
type : "post",
url : "s2.php",
data : {id:id},
cache : false,
success : function(html)
{
$('#msg').html(html);
}});**/
});
});