I have this jQuery snippet used to get the id from input field
$('table th input').change(function() {
var id = $(this).attr('id');
id = parseInt(id);
id = isNaN(id) ? 0 : id;
alert(id);
});
The field ID matches the lines of 'col2Name', etc., and I just want to take 2 from there, for some reason in my warning I always get 0, now when I try to just do:
alert(parseInt('12978sdkjfhakj'));
I get the corresponding answer 12978, why does this not work?
Jimmy source
share