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);

However, that did not work because the text in the cell never seemed
to get updated.  So, I I changed the code to use .html() instead
of .text() :

var total = col1Total + col2Total;
$('#wi_medical_total').html(total);

and it worked just fine.  So, I did some more playing and came up with
this:

var total = 5 + 5 + 'p';
$('#wi_medical_total').text(total);

Which finally worked and changed the text correctly to "10p".  FYI,
"p" was just a random character.

Can anyone see something I am doing wrong or is this a bug in JQuery?

Reply via email to