Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  
<table>
  <tbody>    
    <tr> 
      <td align="center" data-row="1">
        Some content here - - -
        <button onclick="edit(this)" style="cursor:pointer">Edit</button> 
        <button onclick="remove(this)" style="cursor:pointer">Delete</button> 
      </td>   
    </tr> 
    <tr> 
      <td align="center" data-row="2">
        Some content here - - -
        <button onclick="edit(this)" style="cursor:pointer">Edit</button> 
        <button onclick="remove(this)" style="cursor:pointer">Delete</button> 
      </td>   
    </tr>  
    <tr> 
      <td align="center" data-row="3">
        Some content here - - -
        <button onclick="edit(this)" style="cursor:pointer">Edit</button> 
        <button onclick="remove(this)" style="cursor:pointer">Delete</button> 
      </td>   
    </tr>  
  </tbody>
</table>
  
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
  
</body>
</html>
 
function remove(el){
  var row = $(el).parents('td').data('row')
  alert('delete ' + row)
  // delete logic here
}
function edit(el){
  var row = $(el).parents('td').data('row')
  alert('edit ' + row)
  // edit logic here
}
Output

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

Dismiss x
public
Bin info
mihailomisicpro
0viewers