On Wed, Feb 11, 2009 at 1:23 PM, Ricardo Tomasi <ricardob...@gmail.com> wrote: > > Increment/decrement is for variables. You can't use it directly on a > number. Try '3--'. > > Make it simple, if you use subtraction the type conversion is done for > you: > > $index = $('#Index'); > val = $index.val()-1;
Except, as Karl pointed out, val() will return a string. var val = parseInt($index.val()); $index.val(--val);