I am trying to get columns inside row. But I only want to get those columns who does not have class element. How can I do this?
Code:
update_data: function() {
$('#add').click(function() {
var uid = $('input[name="id"]').val();
var fname = $('input[name="firstname"]').val();
var lname = $('input[name="lastname"]').val();
var email = $('input[name="email"]').val();
var phone = $('input[name="phone"]').val();
var table_rows = $('table tbody tr');
table_rows.each(function(i) {
if (i == uid - 1) {
var tr = $(this); //.children("td");
$(tr).each(function(i) {
if (!tr.children("td").hasClass("element")) {
console.log(tr.children("td"));
}
});
}
});
});
}
I think this will done your job
Or:
With all the rows:
You can select all cells, that does not have the "element" class, with this selector:
Just use this selector. It will select all td which has not element class