<p>I need to add a tooltip/alt to a "td" element inside of my tables with jquery.</p>

<p>Can someone help me out?</p>

<p>I tried:</p>

<pre><code>var tTip ="Hello world";
$(this).attr("onmouseover", tip(tTip));
</code></pre>

<p>where I have verified that I am using the "td" as "this".</p>

<p>**Edit:**I am able to capture the "td" element through using the "alert" command and it worked.  So for some reason the "tip" function doesn't work.  Anyone know why this would be?</p>

```
```
$(this).mouseover(function() {
    tip(tTip);
});
```
```
a better way might be to put
```
title
```
attributes in your HTML. That way, if someone has javascript turned off, they'll still get a tool tip (albeit not as pretty/flexible as you can do with jQuery).
```
```
<table id="myTable">
    <tbody>
        <tr>
            <td title="Tip 1">Cell 1</td>
            <td title="Tip 2">Cell 2</td>
        </tr>
    </tbody>
</table>
```
```
and then use this code:
```
```
$('#myTable td[title]')
    .hover(function() {
        showTooltip($(this));
    }, function() {
        hideTooltip();
    })
;

function showTooltip($el) {
    // insert code here to position your tooltip element (which i'll call $tip)
    $tip.html($el.attr('title'));
}
function hideTooltip() {
    $tip.hide();
}
```
```