I have a table of 5 columns, with information, the last column is of actions (Edit, delete, etc). I'm trying to click on an edit icon to enable text editing of all the TDs in the same row except for the last one, since it is a cell of tools, however I do not get it. I have tried
!$(this).is('td:last');
$(this).not('td:last');
!$(this).is(':last');
$(this).not(':last');
I have not got it, what could be going wrong? This is the code.
$(document).on('click','.tool',function(){
var action = $(this).data('action'),
row = $(this).parents('tr'),
row_cloned = $(this).clone(),
id = parseInt(row.data('id'));
switch ( action ) {
case 'edit':
row.find('td').each(function(){
if( !$(this).is('td:last') ){
$(this).prop('contenteditable',true);
}
});
row.find('td:first').focus();
break;
});