I want to do this
var x=$(this).attr('id');
var y = x+1;
where x is an integer
but the value I get is x1
How do I do get the 16, if x=15?
Thanks Jean
I want to do this
var x=$(this).attr('id');
var y = x+1;
where x is an integer
but the value I get is x1
How do I do get the 16, if x=15?
Thanks Jean
All the answers so far are missing the radix parameter
var x=parseInt($(this).attr('id'), 10);
var y = x+1;
parseInt('0123') might return? developer.mozilla.org/en/Core_JavaScript_1.5_Reference/…