1
$("input[name='add'].my").click(function(){
//i tried use this <input type="button" name="add" value=..../>
//element to find his parent's parent the `<div>` object
//how can i get it
});
<div>
<tr>
<td><%= post.title %></td>
<td><%= post.content %></td>
<td><%= link_to 'Show', post %></td>
<td><%= link_to 'Edit', edit_post_path(post),:remote=>true %></td>
<td><%= link_to 'Destroy', post, :confirm => 'Are you sure?',:remote=>true, :method => :delete %></td>
<td><input type="button" name="add" value="add" class="my"/></td>
<td></td>
</tr>
</div>
<div>
<tr>
<td><%= post.title %></td>
<td><%= post.content %></td>
<td><%= link_to 'Show', post %></td>
<td><%= link_to 'Edit', edit_post_path(post),:remote=>true %></td>
<td><%= link_to 'Destroy', post, :confirm => 'Are you sure?',:remote=>true, :method => :delete %></td>
<td><input type="button" name="add" value="add" class="my"/></td>
<td></td>
</tr>
</div>