JSFiddle - React, Tailwind, and code Playground

by mz_arain08

HTML

<table border=1>
<thead>
<tr>
<th>T1</th>
<th>T2</th>
<th>T3</th>
<tr>
</thead>
<tbody>
<tr>
<td colspan="2">Colspan2</td>
<td>No Col</td>
<td colspan="3">Colspan3</td>
</tr>
<tr>
<td>a</td>
<td colspan="1">Colspan1</td>
<td>No-2</td>
</tr>
</tbody>
</table>

JavaScript

$(document).ready(function(){
    $("table").on('click','td[colspan]',function()
                  {
                  console.log($(this));
                  var colspan_val = $(this).attr('colspan');
                      console.log(colspan_val);
                   
                   alert('this is colspan');
                      alert('colspan value: '+colspan_val);
                      
                  })
})