i have the following script
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.
Form field values are always stored as strings. Whether or not they look like integers is irrelevant; they're strings. You need to convert them to integers before treating them as such :)
Values are never integers as such, the fact that you put numbers there instead of who-knows-what is your choice only.
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)