No luck :(
Now it doesn't output anything, tried using:
- $(this).closest('td select').val();
No luck either, same output "undefined". Looks as if its not getting the correct element, is there a way to get the closests element no matter what it is to output it and have an idea of whats the script getting? Ttied:
- $(this).closest().tagName;
But still outputting "undefined...
PD: I found that doing:
- $(this).parents('td:first').attr("id");
Outputs the correct id of the first td, but when I do:
- $(this).parents('td:first select').val();
It outputs a number 2 which isnt the correct value of the selected item (this number happens to be the value of the very first select element in my app, I don't know why "td:first" stops correctly at the first td element and "td:first select" goes to the very first select item on my page).
FIXED: Had to do it this way:
- var dd = $(this).parents('td:first');
- dd.children('select').val();
Don't know why it didn't work the other way though..