JSFiddle - React, Tailwind, and code Playground

by Vinoth Krishnan

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<table id="myTable">
    
</table>

CSS

.test{
  pointer: cursor;
  text-align: underline;
}

JavaScript

$(document).ready(function() {

		for(var i=0; i<= 5; i++){
      $('#myTable').append("<tr><td><input name='strExpDate"+i+"' class='dates'  />  <a class='test'>Link"+i+"</a> <br /> </td></tr>");
    }


    $(".test").click(function(e) {
    		var value = $(e.target).closest('tr').find('.dates').val();
         var name = $(e.target).closest('tr').find('.dates').attr('name');
         alert("Name : "+name+" Value : "+value);
    });
});