[jQuery] Re: search and replace TD innards

2008-10-02 Thread matchoo
Thanks! Yes, I get confused sometimes on what $(this) really is sometimes. Here's the final code. Works great... PS this is for the TableSorter plugin, which hates commas: $(document).ready(function() { $("table").tablesorter({headers: { 3: { sorter: "digit" },4: { sorter: "digit" },5: {

[jQuery] Re: search and replace TD innards

2008-10-02 Thread Dave Methvin
>     number = '' + this.html; You meant $(this).html() I think. However, since you're writing a plugin here, the "this" is a jQuery object and not a DOM object. Here's the way I'd do it, assuming the numbers are all integers (no decimal points): jQuery.fn.addCommas = function(){ return this.e