Ayesha Fathima

Ayesha Fathima

  • NA
  • 184
  • 29.8k

Get second Column value,When user clicks on First column Val

Feb 6 2018 4:38 AM
i have one table which contains two column i.e, 'File name' and 'Base64'.Onclick of table iam giving hyperlink on 'File name' column.If i have 3 tuples,the tuple on which user clicked that file name and base64 values i need to get.Iam able to get 'File name' value,but not able to get that base 64 column value,i hided Base64 column in table.How can i achieve base64 column value??
 
Here what i have tried.in data iam getting file name
 
  1. $('#attachmenttable').on('click'function(e)  
  2.             {  
  3.              e = e || window.event;  
  4.     var data = [];  
  5.     var target = e.srcElement || e.target;  
  6.     while (target && target.nodeName !== "TR") {  
  7.         target = target.parentNode;  
  8.     }  
  9.     if (target) {  
  10.         var cells = target.getElementsByTagName("td");  
  11.         for (var i = 0; i < cells.length; i++) {  
  12.             data.push(cells[i].innerText);  
  13.         }  
  14.     }  
  15.     alert(data);