Problem with val
Problem with val
Hello
I have 5 input texts all with class "myitem", I want know the value of each field to sum. I'm using this code:
-
total_direct=0;
for (i=0;i<=5;i++) {
total_direct=total_direct+$(".items").val()[i];
}
But val() only catch the first value. Why?