The following JavaScript function is supposed to compare two numbers entered in a form and print "yes" if the first number is smaller than the second. It works for two positive numbers; it can compare a positive and a negative number; it cannot compare two negative numbers. Could anyone explain why? Thanks in advance.
function chek(form) {
if (form.elements["a" + 1 + 1].value < form.elements["b" + 1 + 1].value)
form.elements["c" + 1 + 1].value = "Yes";
}
