172
rated 0 times
[
175]
[
3]
/ answers: 1 / hits: 42230
/ 12 Years ago, mon, november 19, 2012, 12:00:00
I am using a function where I have a readonly
text input
, and when I execute the function I want the number value + 1. So let's say I have 60, when I execute the function, the number returned should be 61.
But instead it's coming out 601, which is just adding the number 1 to the string. Any clue as to what is going on? Subtraction, multiplication and division all work fine. Here is a snippet
var num= $(#originalnum).val() + 1;
$(#originalnum).val(num);
And yes i've tried a few different variations, am I missing something?
More From » jquery