Dan,

Yes, I figured it had to do with the type of variable it was and you
are correct, that worked.  However, it still doesn't make sense to me
that it would work for .html() but not for .text().  Why would the two
operate differently?  It just seems inconsistent to me.

On Jul 5, 10:23 am, "Dan G. Switzer, II" <[EMAIL PROTECTED]>
wrote:
> >Live Example:
>
> >http://rcs-comp.com/code_examples/text_function_bug/
>
> >I have some code that has a three column table in it.  When the user
> >updates some number values in one of the two columns, I have some JS
> >that sums those columns and updates the value in the third column with
> >that info.  When updating the third column, which his a TD element, I
> >tried to use text() to do it:
>
> >var total = col1Total + col2Total;
> >$('#wi_medical_total').text(total);
>
> Try changing the code to:
>
> $('#wi_medical_total').text(total.toString());
>
> Without looking at the jQuery source code, my guess is it's looking for you
> to explicitly pass in a String object--not a Number object. Passing in a
> number is probably causes the jQuery to simply discard the operation.
>
> -Dan

Reply via email to