Highdel Highdel - 1 year ago 107
jQuery Question

Easy jQuery issue

If I have a table where a td has a class called "clicky" with the following jQuery code:

var td = $(this);
$.post("http://URL/file.php", {val:value})

How can I replace the HTML in the td that was clicked with the HTML code returned in the data variable? I do not individually name my TDs, so I cannot reference it directly.

Simply using $(this).innerHTML() seems to be out of scope or dysfunctional...

Answer Source

Use html() to replace the existing innerHTML

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download