Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  
  
  <!-- HTML -->
<table id="tb1" cellpadding="5" border="1" cellspacing='0' width="200"> 
  <tr>
    <td id="cb1"><input type='checkbox' /> </td>
    <td id="da1">Data 1</td>
  </tr>
  <tr>
    <td id="cb2"><input type='checkbox' /> </td>
    <td id="da2">Data 2</td>
  </tr>
  <tr>
    <td id="cb3"><input type='checkbox' /> </td>
    <td id="da3">Data 3</td>
  </tr>
  <tr>
    <td id="cb4"><input type='checkbox' /> </td>
    <td id="da4">Data 4</td>
  </tr>
  
  
</table>
  
</body>
</html>
 
$(function(){
  $("#tb1").on('click','input',function(){
      var value =($(this).closest('tr').find('[id^=da]').text())
  alert(value)
  })
})
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers