Jquery: I Have To Use Parseint() Even When Deal With Numbers, Why?
i have the following script
Solution 2:
http://www.uvsc.edu/disted/decourses/mct/2760/IN/krutscjo/lessons/06/ff_05.html
Javascript treats most everything as a string unless you explicitly tell it that it is a number. One notable example of this is getting values from form elements. Depending on the browser and user input you may get some unexpected results.
Solution 3:
Values are never integers as such, the fact that you put numbers there instead of who-knows-what is your choice only.
Solution 4:
jQuery's val() function always returns a string. In many cases you can mix numbers and strings (in arithmic for example), when comparing two string variables, javascript will perform a string comparison, not a numeric comparison (which is to be expected)
Post a Comment for "Jquery: I Have To Use Parseint() Even When Deal With Numbers, Why?"