jQuery selector question
- by Jakey
I have a span and an anchor inside a table cell. I have the anchor set up to show a tooltip. I would like the text inside the span to be used for the tooltip. How can I select this text in jQuery?
<td class="row-head" colspan="5"><span class="tip-text">Complete Coverage</span><a href="#" class="help"></a></td>
JQuery code - the current selector always finds the first instance only for all tips.
$(document).ready(function() {
$('.help').qtip({ style: { name: 'cream', tip: true },
content: {
text: $(this).find('span.tip-text').html()
} });
});
Thanks