On Tue, 8 Aug 2006, Rafael Santos wrote: > i just want to increase a value... > > by jQuery: > var cont = $("#img_counter").val(); //its an input value > cont = parseInt(cont + 5); > $("#img_counter").val(cont); > ... > =( where am i wrong?
You want: cont = parseInt(cont) + 5 The input value is a string. To ensure that it is treated like a number, you have to convert it before you use the + operator, since + is overloaded for numbers and strings. -- .. Dave Benjamin - Software Developer - ramenlabs.com .. AIM: ramenlabs / MSN: [EMAIL PROTECTED] _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/