tags:

views:

18

answers:

1

Working on a tooltip for a table row, I put a span in a table row with a class of "tip" and then tried to select that through find('.tip') but this wouldn't work.

$(".tip_trigger").hover(function(){
tip = $(this).find('.tip');
tip.show();

When I put the .tip class on a td it worked fine showing the tooltip.

+6  A: 

If you use invalid elements/structure, you'll get unpredictable results :)

A <span> cannot be a child of a <tr>, you should lay it out a different way, for example putting that <span> inside a <td> in the row.

Nick Craver
thanks @nick. totally clear. i was able to fix by modifying the layout of the markup. anyone know a good reference of, like, a markup tree that shows relationships between tags/selectors in order of ascension?
hugegoudaface